$ git add cpp/main.cpp $ git commit --fixup=9731e60 $ git log --oneline ab4ca46 (HEAD -> main) fixup! cpp binder die aa278c1 (origin/main, origin/HEAD) java binder callback 9731e60 (tag: v0.3) cpp binder die 19bda12 cpp/java dumpsys server 77dbf97 cpp/java binder linkToDeath test 0ed8e1c update README and makefile 8cbed3f (tag: v0.2) cpp binder code optimization de89247 Merge branch 'main' of https://github.com/hqw700/binderdemo into main 8ae91b8 Gen cpp binder file and test 86ee113 cpp binder gen acd95a8 Create README.md 7e44f1c (tag: v0.1) Gen java binder file and test b4f22b9 Init aidl file
$ git rebase -i --autosquash 9731e60^ $ git log --oneline efe605c (HEAD -> main) java binder callback cd0d752 cpp binder die 19bda12 cpp/java dumpsys server 77dbf97 cpp/java binder linkToDeath test 0ed8e1c update README and makefile 8cbed3f (tag: v0.2) cpp binder code optimization de89247 Merge branch 'main' of https://github.com/hqw700/binderdemo into main 8ae91b8 Gen cpp binder file and test 86ee113 cpp binder gen acd95a8 Create README.md 7e44f1c (tag: v0.1) Gen java binder file and test b4f22b9 Init aidl file
push到远程
因为commit id都变了,push到远程也会提示先pull。pull之后会发现有冲突。
1 2 3 4 5 6 7 8 9 10 11 12 13
$ git push origin main To https://github.com/hqw700/binderdemo ! [rejected] main -> main (non-fast-forward) error: failed to push some refs to 'https://github.com/hqw700/binderdemo' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
$ git pull Auto-merging cpp/main.cpp CONFLICT (content): Merge conflict in cpp/main.cpp Automatic merge failed; fix conflicts and then commit the result.