What's the difference between ignore a folder and untrack in git? I need to remove some folders from my git repository and I am working in Netbeans with the git plugins and put by mistake the build, dist, and nbproject folders in my repository and now I need to remove those folders.
相关问题
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
- Upload file > 25 MB on Github
相关文章
- 请教Git如何克隆本地库?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
- ssh: Could not resolve hostname git: Name or servi
- Cannot commit changes with gitextensions
- git: retry if http request failed
By "ignore" I assume you mean
.gitignore
, which is a special file you can make thatgit
will read to determine a set of files and/or directories to ignore. You can override this, but generally these files will be hidden from anygit
operation."Untracked" in
git
just means that you haven't added the file to the repository yet.If a file is untracked and excluded by the
.gitignore
, you won't even see it viagit status
or any othergit
command.To solve your current problem, where you have already accidentally added files that you do not want to track and want to ignore, first add those folders to your
.gitignore
and then try this command:This will remove the undesired directories from your repo but will not delete them from your local working copy.
You will want to use untrack instead of gitignore as gitignore won't affect files that are currently being tracked. http://git-scm.com/docs/gitignore
If you create a file in your repository named .gitignore, git will use its rules when looking at files to commit. git will not ignore a file that was already tracked (i.e. was in the repo) before a rule was added to this file to ignore it. File must be un-tracked (removed from the repo) using
The command will stop tracking but keep the file there intact.