git命令

来源:互联网 发布:道奇垂耳兔 知乎 编辑:程序博客网 时间:2024/05/16 08:47

git命令

git rebase -i –root

git push –force

git reset HEAD Hello_Triangle // from stage to motified

git checkout – Hello_Triangle.c // cancel the motified

git remote show origin//check the remote server

git status 查看更改过的文件
git add path/to/files 将更改过的文件加入
git commit -m “title” 第一次提交时执行,写消息的标题
git commit –amend 写详细信息。详细信息要写在ChangeID之前,即保证ChangeID在最后
git pull –rebase rebase一下
git push origin HEAD:refs/for/master

除了使用–no-commit 在合并以前就取消提交以外,如果你已经合并了,但是不想提交,可以先
git commit
然后
git log找到上一个版本commit id(下文用xxxx指代)
git reset xxxx
然后再
git add .
git commit –amend就可以把合并进来的内容,放进之前的commit中了

git fetch origin master:tmp
git diff origin
git merge origin

git stash # save uncommitted changes
——pull, edit, etc.
git stash list # list stashed changes in this git
git show stash@{0} # see the last stash
git stash pop # apply last stash and remove it from the list

git stash –help # for more info

git reset HEAD xxx cancel the file in changed area

git pull and git fetch /merge

git merge –no-commit

git log –grep=word //find the word in git log

原创粉丝点击