美文网首页
git常用命令

git常用命令

作者: 抓虫的蜗牛 | 来源:发表于2020-04-13 16:38 被阅读0次
  • 查看远程分支:$ git branch -a
  • 查看本地分支:$ git branch
  • 创建分支: $ git branch mybranch
  • 切换分支: $ git checkout mybranch
  • 创建并切换分支: $ git checkout -b mybranch
  • 更新master主线上的东西到该分支上:$git rebase master
  • 将origin中的代码推到develop:git push -u origin develop
  • 将所有代码改动提交到缓存区:git add --all
  • 将代码提交到存储库:git commit -m 'add code'
  • 将代码提交到远程仓库:git push
  • 创建附注标签:git tag -a v0.1 -m 'basecode 0.1'
  • 推送标签到远程仓库:git push origin v0.1
  • 列出所有标签:git tag
  • 把主分支的代码merge到自己的分支(在其它分支中):git merge master
  • 撤回某个文件的add操作:git reset HEAD /pycache/
  • 删除.idea远程文件(然后commit,再push):git rm —cached -r .idea

相关文章

网友评论

      本文标题:git常用命令

      本文链接:https://www.haomeiwen.com/subject/ukknmhtx.html