git 实用命令

git clone ssh:/git@xxxxxxxx.com:2222/xxxxxx/x/x/x.git      //克隆项目
git fetch origin dev-lhc:dev-lhc    
git checkout dev-lhc
git pull
git branch --set-upstream-to=origin/dev-lhc
git checkout dev
git merge dev-lhc
git add .
git commit -m "xxxxxxxx"
git push

git checkout dev
git branch
git merge dev-lhc
git add .
git commit -m "xxxxx"
git push

// 写好代码后在自己的分支提交到暂缓区 git add .
// 提交然后写好备注 git commit -m "写备注"
// 上传git push   如果没有关联远程仓库会提示让关联如:git push --set-upstream origin 自己的分支名
// 进行关联远程仓库 git push --set-upstream origin 自己的分支名   
// 然后  git push   上传到自己的远程仓库
// 切换到主分支 git checkout 主分支名 
// 取回某个分支更新的代码 git pull
// 自己的分支与主分支的合并 git merge 自己的分支名
// 提交到暂缓区  git add .
// 提交然后写好备注 git commit -m "写备注"
// 同步到主分支git push
 
原文地址:https://www.cnblogs.com/1609359841qq/p/13031841.html