简体   繁体   中英

SourceTree .gitignore extensions

I'm very new to git/SourceTree. (2) other devs have committed extension files, such as .proj , .cache , etc into the master branch. I added a .gitignore file and merged that into the master branch (we have a develop branch as well now). However, after the merge, I built the project in VS, and I'm still seeing "ignored" files in my "Unstaged files" section in SourceTree.

I read here that I need to "stop tracking" the files. When I do this (for the .suo for instance), it pops it up to the "Staged files" and has the red icon next to it. Is this correct, as should I do this for all files?

I've also read about git clean .

Cleans the working tree by recursively removing files that are not under version control, starting from the current directory.

Normally, only files unknown to Git are removed, but if the -x option is specified, ignored files are also removed . This can, for example, be useful to remove all build products.

Would I run against the master branch in bash? Otherwise how would I go about cleaning the repository up, removing ignored files.

After creating and committing the .gitignore file, what I did was go into the directories and temporarily move the folders and files that needed to be excluded from git out of the project folder, so that SourceTree would pick up the changes. Then I stopped tracking on these files/folders and pushed up.

I had same problem. Make sure you have "Pending" filter selected in Sourcetree. If filter is all then it will show all files including ignored.

SourceTree过滤器

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM