操作命令:git设置和提交代码

git设置rebase,可以有效防止代码merge过度、代码误覆盖的问题
 
git config --global pull.rebase true 
 

一般的代码提交过程如下:
1. git stash 把自己改的内容压栈,就是存起来
2. git pull 第1步执行后本地没有改动了,可以pull代码了
3. git stash pop 把第1步存起来的恢复
4. git add .
5. git commit -m "注释"
6. git push

 
https://stackoverflow.com/questions/13846300/how-to-make-git-pull-use-rebase-by-default-for-all-my-repositories
 

git 查看commit提交的内容

查看某次commit修改了哪些内容,与之相关的命令就是:
git log
git show

先通过git log打印所有commit hashID,之后的git show都是基于commit hashID输出的。
1.查看最新的commit
git show

2.查看指定commit hashID的所有修改:
git show commitId

posted @ 2022-02-16 11:17  算法阿杰  阅读(166)  评论(0)    收藏  举报