-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
2.5.2
-
None
-
Severity 3 - Minor
Adding files to the global gitignore (usually) doesn’t trigger the automatic refresh, but it should.
Setup
- In SourceTree, make sure “Refresh automatically when files change” is checked. Confirm this:
~/ $ mkdir demoIgnoreGlobal ~/ $ cd demoIgnoreGlobal/ demoIgnoreGlobal/ $ git init Initialized empty Git repository in ~/demoIgnoreGlobal/.git/
- Open ~/demoIgnoreGlobal in SourceTree. SourceTree correctly displays it as an empty repository.
demoIgnoreGlobal/ $ touch theBaz
SourceTree will detect this file and automatically refresh (it may take a second or two), showing theBaz as unstaged.
- Confirm that command-line git sees the file:
demoIgnoreGlobal/ $ git status On branch master Initial commit Untracked files: (use "git add <file>..." to include in what will be committed) theBaz nothing added to commit but untracked files present (use "git add" to track)
demoIgnoreGlobal/ $ echo theBaz > .gitignore
SourceTree will detect this change, correctly showing .gitignore as unstaged and hiding theBaz.
- Now that we’ve confirmed that the auto-refresh does work, remove the local .gitignore.
demoIgnoreGlobal/ $ rm .gitignore
SourceTree correctly shows theBaz as unstaged once again.
- Confirm that the global .gitignore is set up correctly.
demoIgnoreGlobal/ $ git config --get core.excludesFile /Users/<username redacted>/.gitignore_global
- Open the SourceTree preferences pane, switch to the Git tab, and confirm that the path in the dialog matches the result of that command.
Test
demoIgnoreGlobal/ $ echo theBaz >> ~/.gitignore_global
Watch SourceTree for a while. Most of the time, theBaz will not disappear. (It happened to me once, but I think I must have clicked something that triggered a refresh.)
- Click the file listing for theBaz. Double-click theBaz to have SourceTree open the file. SourceTree doesn’t refresh.
- Confirm that command-line git no longer sees the file:
demoIgnoreGlobal/ $ git status On branch master Initial commit nothing to commit (create/copy files and use "git add" to track)
Environment
SourceTree-Beta Version 2.5.2 (109) (per the About dialog)