Skip to content

Instantly share code, notes, and snippets.

@johndrinkwater
Created November 22, 2017 15:14
Show Gist options
  • Save johndrinkwater/b956768415285d932a6cf7479bb2061f to your computer and use it in GitHub Desktop.
Save johndrinkwater/b956768415285d932a6cf7479bb2061f to your computer and use it in GitHub Desktop.
What I do when I want a cruft-free merge that requires a rebase and edit due to a conflict.
john@joran ~/code/SteamLinux ±:master❯ git pull
remote: Counting objects: 385, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 385 (delta 248), reused 253 (delta 248), pack-reused 132
Receiving objects: 100% (385/385), 82.41 KiB | 0 bytes/s, done.
Resolving deltas: 100% (250/250), completed with 4 local objects.
From github.com:SteamDatabase/SteamLinux
bd6f35b1e552..76f7006185dc master -> origin/master
* [new ref] refs/pull/606/head -> origin/pr/606
Updating bd6f35b1e552..76f7006185dc
Fast-forward
GAMES.json | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 115 insertions(+), 1 deletion(-)
john@joran ~/code/SteamLinux ±:master❯ git checkout pr/606
john@joran ~/code/SteamLinux ±:pr/606❯ git rebase master -i
Stopped at febcfeeea8d4... 911 Operator (503560) works
You can amend the commit now, with
git commit --amend
Once you are satisfied with your changes, run
git rebase --continue
john@joran ~/code/SteamLinux ±:pr/606|REBASE-i 1/4❯ gvim GAMES.json
john@joran ~/code/SteamLinux ±:pr/606 *|REBASE-i 1/4❯ git add GAMES.json
john@joran ~/code/SteamLinux ±:pr/606 +|REBASE-i 1/4❯ git commit --amend
[detached HEAD 7c7978893d71] 911 Operator (503560) works
Author: Jason Rivers <[email protected]>
Date: Sat Nov 18 10:11:41 2017 +0000
1 file changed, 1 insertion(+)
john@joran ~/code/SteamLinux ±:pr/606|REBASE-i 1/4❯ git rebase --continue
[detached HEAD 8a8d0cb7375e] 911 Operator (503560) works
Author: Jason Rivers <[email protected]>
Date: Sat Nov 18 10:11:41 2017 +0000
1 file changed, 1 insertion(+)
error: could not apply 6451c0d3ad3c... Think To Die 3 (611320) works
When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".
Could not apply 6451c0d3ad3cb1f3733d3b61af71841398c2c3ae... Think To Die 3 (611320) works
john@joran ~/code/SteamLinux ±:pr/606 *+|REBASE-i 4/4❯ git add GAMES.json
john@joran ~/code/SteamLinux ±:pr/606|REBASE-i 4/4❯ git commit --amend --author="Jason Rivers <[email protected]>" --date="2017-11-18 10:19:13"
[detached HEAD 7227d1a6a6c5] Think To Die 3 (611320) works
Author: Jason Rivers <[email protected]>
Date: Sat Nov 18 10:19:13 2017 +0000
1 file changed, 1 insertion(+)
john@joran ~/code/SteamLinux ±:pr/606|REBASE-i 4/4❯ git rebase --continue
Successfully rebased and updated refs/heads/pr/606.
john@joran ~/code/SteamLinux ±:pr/606❯ git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
john@joran ~/code/SteamLinux ±:master❯ git merge --ff pr/606
Updating 76f7006185dc..7227d1a6a6c5
Fast-forward
GAMES.json | 3 +++
1 file changed, 3 insertions(+)
john@joran ~/code/SteamLinux ±:master❯ git add GAMES.json
john@joran ~/code/SteamLinux ±:master +❯ git log | grep 508530
Add HackyZack (508530), Tiny Echo (629770) and Nongünz (633130)
john@joran ~/code/SteamLinux ±:master +❯ git commit
[master c4aeb4b10fef] Remove comment from HackyZack (508530)
1 file changed, 1 insertion(+), 4 deletions(-)
john@joran ~/code/SteamLinux ±:master❯ git push origin master
Counting objects: 12, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (12/12), 1.23 KiB | 0 bytes/s, done.
Total 12 (delta 8), reused 0 (delta 0)
remote: Resolving deltas: 100% (8/8), completed with 2 local objects.
To github.com:SteamDatabase/SteamLinux.git
76f7006185dc..c4aeb4b10fef master -> master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment