-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgit-flow-basic.sh
21 lines (21 loc) · 1.23 KB
/
git-flow-basic.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#
# UPSTREAM/ORIGIN sync
# next syncs local master and origin/master with upstream/master
git config --global alias.sync-master-upstream '!git checkout master && git pull upstream master && git push origin master'
git config --global alias.sync-main-upstream '!git checkout main && git pull upstream main && git push origin main'
#
# next syncs current branch recursively with upstream and local & origin master
git config --global alias.sync-branch-upstream-merge-master '!git sync-master-upstream && git checkout - && git merge master'
git config --global alias.sync-branch-upstream-merge-main '!git sync-main-upstream && git checkout - && git merge main'
#
# ORIGIN sync
# next syncs local master and origin/master from any branch
git config --global alias.sync-master '!git checkout master && git pull origin master && git checkout -'
git config --global alias.sync-main '!git checkout main && git pull origin main && git checkout -'
#
# next rebases feature branch onto master
git config --global alias.sync-branch-rebase-master '!git rebase master'
git config --global alias.sync-branch-rebase-main '!git rebase main'
#
# next completes rebase after conflict resolution
git config --global alias.sync-branch-continue '!git add . && git rebase --continue'