Git命令集

159 阅读1分钟
  • 克隆git远程仓库代码到本地

git clone gitlab.ggggg.com/44444(git远程仓库地址)

  • 从远程代码库获取最新代码到本地分支并合并

拉取:git fetch origin branchName // origin为远程分支,branchName为本地分支

合并:git merge origin/branchName

  • 查看提交日志 git log

git merge --no-ff hotfix_brand_tree

git push --set-upstream origin hotfix_brand_tree

  • 打tag

在本地打tag : git tag [tagName]

将本地tag推送到远程:git push origin <tagName>

git fetch // 更新

将master合并到自己的分支

  1. 切换到master分支: git checkout master
  2. 将master更新的代码pull到本地: git pull
  3. 切换到自己的分支上:git checkout branchname
  4. 合并master到自己的分支: git merge master
  5. 将自己分支的代码提交到远程: git push origin branchName

持续更新....