0

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.

Community
  • 1
  • 1
Rob Scott
  • 7,921
  • 5
  • 38
  • 63

2 Answers2

0

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.

Rob Scott
  • 7,921
  • 5
  • 38
  • 63
0

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 Filter

Digital_Reality
  • 4,488
  • 1
  • 29
  • 31