Another nice thing would be a way to exclude file specs in git diff (Hack: add 'true' as a diff program in .git/config and use .gitattributes to exclude by setting diff=true).
Another nice thing would be a way to exclude file specs in git diff (Hack: add 'true' as a diff program in .git/config and use .gitattributes to exclude by setting diff=true).
Under the hood `git pull` is just `git fetch`+`git merge` so these two configs together would ideally enable the behavior requested (but unfortunately don't):
[fetch]
all = true
[pull]
ff = only
I also disable fast-forwarding with `git merge` since I prefer the branch topology you get without it. This doesn't break natural `git pull` fast-forwarding either, thanks to the above config: [merge]
ff = false
Commands to set all these: git config --global fetch.all true
git config --global pull.ff only
git config --global merge.ff false(we're in branch A)
>git pull
...
From ...
rev1..rev2 A -> origin/A
rev3..rev4 B -> origin/B
Updating rev1..rev2
Fast-forward
---
The fast-forward is on branch A. I'd like the git pull to also fast-forward branch B (and branches C,D,Etc.). They're usually by other devs, I don't usually check these, but when I do, I could save an extra command when switching if git just moved the branch head with the data it already has.
git checkout origin/A
There's no reason to clutter `git branch list` output with branches I don't care about.Your idea is interesting, didn't know that's useful. Detached head is a bit annoying though.
Thinking on this more I think I'd prefer changing `git checkout/switch <branch>` to automatically use `origin/<branch>` instead (like mook mentions in a sibling comment), rather than changing the `git pull` behavior.
Keeping the local branch refs in place after `git pull` lets you still easily see the local vs remote differences when running `git log`. Changing the behavior of `git checkout` or whatever you use to switch branches to auto fast-forward seems to be a way to have your cake and eat it too, almost.
But, clearly you've thought more on this than I have (having just learned about it lol), what do you think?