Leif160519的blog Leif160519的blog

——————

目录
Git用法:将本地代码提交到远程仓库
/  

Git用法:将本地代码提交到远程仓库

git init
git remote add origin git@github.com:Leif160519/centos-script.git
git add .    //gaa
git status   //gst
git  commit -m '提交信息’  //gcmsg '提交信息’
git push --set-upstream origin master //第一次这个命令,以后直接git push  //gp <分支名>
git log -line //查看所有commit信息
git reset <hash>回滚代码
git merge //gm 合并
git  checkout -b <分支名>//gco 创建并切换到当前分支
gco <分支名> 切换分支
git pull <远程分支名>  //拉取代码并合并gpl
git fetch <远程分支> //拉取不合并分支
git diff  //列举修改的部分

“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill

标  题Git用法:将本地代码提交到远程仓库
作  者Leif160519
出  处https://github.icu/articles/2019/08/22/1566472908198.html
关于博主:坐标南京,运维工程师,如有问题探讨可以直接下方留言。
声援博主:如果您觉得文章对您有帮助,可以评论、订阅、收藏。您的鼓励是博主的最大动力!