File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,14 @@ Alias to create a commit and pre-fill the commit message with the most recent co
56
56
57
57
See [ Recover failed Git commit message] ( https://salferrarello.com/recover-failed-git-commit-message/ )
58
58
59
+ ### ` git rhu ` (and ` git frhu ` )
60
+
61
+ Alias for ` git reset --hard @{upstream} ` to discard local changes and reset the branch to match the upstream (` @{upstream} ` ) branch.
62
+
63
+ ` git frhu ` does the same thing but performs a ` git fetch ` first to ensure we have the latest version of the upstream branch.
64
+
65
+ See [ Replace Local Git Branch with Branch on GitHub] ( https://salferrarello.com/replace-local-git-branch-with-branch-on-github )
66
+
59
67
### ` git track-origin-same-branch-name `
60
68
61
69
Alias for ` git branch --set-upstream-to=origin/$(git rev-parse --abbrev-ref HEAD) ` .
Original file line number Diff line number Diff line change 46
46
}; f"
47
47
please = push --force-with-lease
48
48
recover-rejected-commit = "!f() { git "commit -e --file=$(git rev-parse --git-dir)/COMMIT_EDITMSG"; }; f"
49
+ rhu = reset --hard @{upstream}
50
+ frhu = !git fetch && git reset --hard @{upstream}
49
51
track-origin-same-branch-name = !git branch --set-upstream-to=origin/$(git rev-parse --abbrev-ref HEAD)
50
52
[branch]
51
53
sort = -committerdate
You can’t perform that action at this time.
0 commit comments