git status
查看区别
git diff
将diff文件转成patch
git diff > patch
git add .
首次提交,加上签名sign
git commit -s
非首次提交
git commit --amend
git push https://gitee.com/username/project.git HEAD:branchname -f
git pull
git pull --rebase
本地代码仓查找"<<<<<<"解冲突
git status
git add .
git rebase --continue
git push https://gitee.com/username/project.git HEAD:branchname -f
git checkout .
git clean -f
git reset --hard FETCH_HEAD
git reset --hard commitid
git fetch https://gitee.com/project.git pull/xxxx/head:pr_xxxx
git branch
git checkout branchname
git fetch https://gitee.com/project.git pull/xxxx/head:pr_xxxx
git reset --hard commitid
git log --oneline291e427 update website
8c8f3f4 update website
1693a6f update clear-logs.sh version
3759b84 update clear-logs.sh
fc36a2a add links
1d795e6 fix && update clear-logs.sh 0.0.2
9536dab add dingtalk script
3a51aaa fix shellcheck problem
2db6ad3 add clear logs scripts
e57b0e6 fix && add batch del
17cb931 fix && add batch del
cf7e875 add redis script
fe4bbcb Initial commit
# 合并指定版本号(上步中cf7e875不参与合并)
git rebase -i cf7e875
pick 17cb931 fix && add batch del
pick e57b0e6 fix && add batch del
pick 2db6ad3 add clear logs scripts
pick 3a51aaa fix shellcheck problem
pick 9536dab add dingtalk script
pick 1d795e6 fix && update clear-logs.sh 0.0.2
pick fc36a2a add links
pick 3759b84 update clear-logs.sh
pick 1693a6f update clear-logs.sh version
pick 8c8f3f4 update website# Rebase cf7e875..291e427 onto cf7e875 (10 commands)
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
# d, drop = remove commit
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
# Note that empty commits are commented out
除了最上面的保持"pick"状态其他全部改成"s"
pick 17cb931 fix && add batch del
s e57b0e6 fix && add batch del
s 2db6ad3 add clear logs scripts
s 3a51aaa fix shellcheck problem
s 9536dab add dingtalk script
s 1d795e6 fix && update clear-logs.sh 0.0.2
s fc36a2a add links
s 3759b84 update clear-logs.sh
s 1693a6f update clear-logs.sh version
s 8c8f3f4 update website
:wq 保存退出
修改完 :wq 保存退出
有几个^就会打几个patch,从最近一次打起
git format-patch HEAD^
git apply --reject patch
git am -3 xxx.patch