git pull --rebase --autostash
Yes, just like that!
Caution: This is not revert, and only do this for personal commits | |
### Steps | |
1. `git log` | |
2. get the hash | |
3. `git reset --hard <hash> | |
### (Alternative) Steps | |
1. `git log` | |
2. `git reset --hard HEAD~1` (This reset previous 1 commit) |
git pull --rebase --autostash
Yes, just like that!
git remote rename origin upstream
git remote add origin URL_TO_GITHUB_REPO
git push origin master
git pull upstream master && git push origin master
Git push existing repo to a new and different remote repo server?
!! This is directly copied from the stack exchange !!
Method A: Cherry Pick changes from another branch one by one, or by ranges
l
and then o
to get a list of other branches.A
followed by A
again. You can also select the lines with the commit range you want with C-space and press A followed by A again.feature/ABC~4
Enter
to apply changes.Method B: Cherry Pick all changes from another branch
A
to choose the cherry pick mode.A
again to apply and commit changes. Press a to only apply changes.Enter
.git ls-tree -r --name-only HEAD | tree --fromfile
Works like a charm. At least for me.