工作流

gitlab
这里只介绍码云的用法。
https://blog.51cto.com/u_16172166/7041348
git init
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/char1es_lec/git_study.git
git push -u origin master

推dev分支:


下载:
git clone https://gitee.com/char1es_lec/git_study.git
#所以分支
git checkout dev
git branch

免密登录:
url中体现
https://gitee.com/char1es_lec/git_study.git
#改为
https://用户名:密码@gitee.com/char1es_lec/git_study
#或者
git remote add origin https://用户名:密码@gitee.com/char1es_lec/git_studyssh实现

ssh-keygen
#然后一直回车
cat ~/.ssh/id_rsa.pub
#copy内容
#找到ssh秘钥设置添加ssh
git remote add origin git@gitee.com:char1es_lec/git_study.git
#再进行
git push origin mastergit自动管理凭证
mac的钥匙串设置rabase相关(变基):
让代码提交更简洁

#当前开始的3条合并
git rebase -i HEAD~3
改为s

我这里全部改为&

git log:

注意:尽量对未提交到仓库的代码操作
合并分支:
这里切到dev进行开发


git log --graph --pretty=format:"%h %s"
遇到冲突,收动解决
解决冲突:
软件beyond Compare
git config --local merge.tool bc3
git config --local mergetool.path '/usr/local/bin/bcomp'
git config --local mergetool.keepBackup false
git mergetool









