美文网首页
GIT 常用命令

GIT 常用命令

作者: 罗尼马特 | 来源:发表于2019-03-14 10:10 被阅读0次

1、提交命令

git clone <git仓库地址>
git add . //全部添加到暂缓区
git add <filename> //选择添加到暂缓区
git commit -m <"自定义信息">
git push origin <branch>

2、切换分支

git checkout <branch>

3、git 放弃本地修改(即没 add 也没 commit)

git checkout . //全部放弃
git checkout --fliename

4、git 放弃暂存区的修改 (只add没有commit)

git reset HEAD filename

5、 git 放弃已经 commit 的修改

git reset --hard <commitID>

6、删除远程分支

git push origin --delete <branch>

相关文章

网友评论

      本文标题:GIT 常用命令

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