-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Git] 常用命令 #5
Comments
|
tips
|
|
fatal: Not possible to fast-forward, aborting.合并代码时出现这个提示,说明远端和本地的提交冲突。这个时候应该取消本地的提交,暂存起来。先pull, 解决冲突 |
git rebasegit rebase 可以合并几个提交为1个提交
输入 git reabse 命令后,就会到vim 的界面。
输入 wq 保存后,重新编辑提交信息,再wq即可 变基分支从a 签出 b 之后,a更新后,可以 变基 a分支
这样 b合并到 a时,合并的线是一条直线 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
git reset <commit_id>
重置某个提交,会将对应更改进行回撤,提交一个新的提交git reset --hard <commit_id>
重置到某个提交,该提交之后的所有更改都会丢失,不会产生新提交git reset --soft <commit_id>
重置到某个提交,该提交后的所有更改会回到暂存区,不会产生新提交git commit --amend
可以对已经提交的内容进行追加git reset --hard origin/master
丢弃本地提交,重置为远端最新提交The text was updated successfully, but these errors were encountered: