美文网首页
Git常用命令

Git常用命令

作者: liyc_dev | 来源:发表于2017-02-15 10:42 被阅读17次

迁移自开源中国

git --help

git clone

从远程仓库拷贝代码到本地

git status

git pull --rebase

更新远程仓库代码到本地(相当于fetch+merge,但是多人合作时不够安全,所以建议用pull),加--rebase是避免commit连成环状,这样更简单,便于管理和维护。

git push

将本地代码推送到远程仓库

git add -A

git commit -a -m ""

git stash

git stash apply(pop)

git branch -av

git checkout

git merge branchName

将branchName分支的代码merge到当前分支

git rebase master branchName

将当前分支代码rebase到branchName分支

git tag

git checkout -b newBranchName tagName(commitID)

新建分支newBranchName用于展示tagName(commitID)的代码

git log

相关文章

网友评论

      本文标题:Git常用命令

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