I'm trying to get started using Git and TortoiseGit.
Is there a way to hide files that should never be tracked completely? Currently, all temporary build files are in the same "Not Versioned" list as new files when I commit a change.
If you want to ignore a file that you've committed in the past, you'll need to delete the file from your repository and then add a .gitignore rule for it. Using the --cached option with git rm means that the file will be deleted from your repository, but will remain in your working directory as an ignored file.
gitignore are not being tracked, you can use the git clean command to recursively remove files that are not under version control. Use git clean -xdn to perform a dry run and see what will be removed. Then use git clean -xdf to execute it. Basically, git clean -h or man git-clean (in unix) will give you help.
Most untracked files will be staged and committed. Others will simply be ignored by including them in the . gitignore file. However, some files and directories will remain untracked, and in certain instances it can be useful to delete these untracked files from your Git repo.
Create a text file called .gitignore
in your root folder and add lines like the following to exclude files:
*.obj
test.c
Then add .gitignore to your Git repository and commit:
$ git add .gitignore
$ git commit .gitignore
You need to investigate .gitignore files.
git help gitignore
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With