4 ms·
same here but I switch to master first: resync = !git reset --hard HEAD && git checkout master && git reset --hard origin/master && git pull or with a paramet
by etqwzutewzu 10y ago
same here but I switch to master first:
resync = !git reset --hard HEAD && git checkout master && git reset --hard origin/master && git pull
or with a parameter to do the same with any branch:
resync = "!f() { git reset --hard HEAD && git checkout $1 && git reset --hard @{u} && git pull ; }; f"
- derwiki 10y agoI use a very similar version of this, and people are often surprised that I'm working directly on master. Well, when it's ready to go, `git checkout -b feature/name; git push origin HEAD; git resync`.