Skip to content

Commit 8dd641c

Browse files
committed
Add Clean Up Old Remote Tracking References as a git til.
1 parent ad7f5f4 commit 8dd641c

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
5656
- [Checkout Old Version Of A File](git/checkout-old-version-of-a-file.md)
5757
- [Checkout Previous Branch](git/checkout-previous-branch.md)
5858
- [Clean Out All Local Branches](git/clean-out-all-local-branches.md)
59+
- [Clean Up Old Remote Tracking References](git/clean-up-old-remote-tracking-references.md)
5960
- [Delete All Untracked Files](git/delete-all-untracked-files.md)
6061
- [Determine The Hash Id For A Blob](git/determine-the-hash-id-for-a-blob.md)
6162
- [Dry Runs in Git](git/dry-runs-in-git.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Clean Up Old Remote Tracking References
2+
3+
After working on a Git-versioned project for a while, you may find that
4+
there are a bunch of references to remote branches in your local repository.
5+
You know those branches definitely don't exist on the remote server and
6+
you've removed the local branches, but
7+
you still have references to them lying around. You can reconcile this
8+
discrepancy with one command:
9+
10+
```bash
11+
$ git fetch origin --prune
12+
```
13+
14+
This will prune all those non-existent remote tracking references which is
15+
sure to clean up your git log (`git log --graph`).
16+
17+
[source](http://stackoverflow.com/a/3184742/535590)

0 commit comments

Comments
 (0)