![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
git
代码管理
c_reshape
I went from zero
展开
-
Gitlab修改项目备注
gitlab原创 2022-06-02 13:40:27 · 1074 阅读 · 0 评论 -
Git之commit后,如何撤销commit,保存工作区的修改
解决方法:git reset --soft HEAD^命令详解:HEAD^ 表示上一个版本,即上一次的commit,也可以写成HEAD~1如果进行两次的commit,想要都撤回,可以使用HEAD~2--soft不删除工作空间的改动代码 ,撤销commit,不撤销git add file--hard删除工作空间的改动代码,撤销commit且撤销add原创 2022-03-24 11:27:51 · 1585 阅读 · 0 评论 -
Git之更改提交消息(提交尚未推送上线)
对于你的最近一次提交,1、简单地修改提交信息。将最后一次的提交信息载入到编辑器中供你修改。 当保存并关闭编辑器后,编辑器会将更新后的提交信息写入新提交中,它会成为新的最后一次提交。git commit --amend2、通过添加、移除或修改文件来更改提交实际的内容。作出你想要补上的修改, 暂存它们,然后用git commit --amend将新的改进后的提交来替换掉旧有的最后一次提交。git add .git commit --amendtip1:使用这个技巧...原创 2021-07-20 11:10:29 · 276 阅读 · 0 评论 -
Git之git rebase master和git rebase origin/master的区别
The different is to rebase on your local master, or the one of origin. It's likely that your local master is behind origin/master, but it could be also forward or even has different histories (not recommend)If yourmasteris the same asorigin/master, it...原创 2021-04-27 21:50:00 · 4504 阅读 · 1 评论 -
Git之git merge
git merge branchA出现冲突:1、解决冲突2、git add xxx3、git commit 4、删除conflict相关的行5、git push origin currentBranch原创 2021-03-10 10:28:04 · 81 阅读 · 0 评论 -
Git之git cherry-pick
对于多分支的代码库,将代码从一个分支转移到另一个分支。只需要部分代码变动(某几个提交),可以采用 Cherry pick。git cherry-pick <commitHash> // 转移一次commitgit cherry-pick branchName // git cherry-pick命令的参数,不一定是提交的哈希值,分支名也是可以的,表示转移该分支的最新提交git cherry-pick <commitHashA> <commitHashB>原创 2021-03-04 11:00:15 · 127 阅读 · 1 评论 -
Git之git push error: src refspec master does not match any.
git push origin master遇到报错:error: src refspec master does not match any. error: failed to push some refs to 'ssh://xxxxx.com/project.git'解决方案:Trygit show-refto see what refs you have. Is there arefs/heads/master?git show-ref 2.You c...原创 2021-03-04 09:45:05 · 90 阅读 · 1 评论