I'm a new SourceTree (and GitHub) user. For one of my repos I was able to specify that ceratin files were to be ignored and not "checked in or pushed" to GitHub. SourceTree honored my request. I also indicated that this should apply to all projects and it looks like that request was also honored. However, one of my specifications indicated all files under a certain folder, of course that folder has a different parent from project to project. So, my question is (again I'm a new user) for my latest project that was added to GitHub, how do I specify to Source Tree that certain files should be ignored. I'm not sure what state I have to get everything in in order for the ignore menuitem to become enabled. Also, from SourceTree, how do I delete a folder from GitHub (w/o deleting the folder from my local project on disk)?
Thank you very much,
You can create a file called .gitignore within specific repos and list files (or patterns using *s) to be ignored. This all that SourceTree is doing when you use that option, and it may be easier to just edit the file manually. There is a lot of documentation out there on how to use .gitignore files. You can put a .ignore file at the top level of the repo and/or in any individual folder within the repo. The behavior inherits down.
Note that telling Git (SourceTree) to ignore a file does not remove that file from the repository if it has already been added. In git you would do this with git rm --cached (if you want to remove the file from the repo but not remove it from the working directory). In SourceTree, you can right-click on a file and select "Stop Tracking".
It's not really possible to delete a folder from a remote because that folder is present in whatever commits you've already pushed to the remote, and you can't remove a folder from a commit once its been committed. You can stop tracking the folder locally (without deleting it from the working directory) and then it won't be present in your next commit.
Git Bash in windows has gotten a lot better.
Within Windows 10, you can run through Git Bash, all the normal git commands to get what you want.
git config --global core.excludesfile ~/.gitignore_global
You can also remove the '--global' to have it apply only to you current repo/ project.
git config core.excludesfile ~/.gitignore_global
Atlassian Summit is an excellent opportunity for in-person support, training, and networking.Learn more
Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs