第1行: 第1行:
 
GIT CHEATSHEET!
 
GIT CHEATSHEET!
 
Ref: http://spheredev.org/wiki/Git_for_the_lazy
 
Ref: http://spheredev.org/wiki/Git_for_the_lazy
 +
Ref: https://makandracards.com/makandra/topics/version-control
  
 
== 撤销上次 git commit ==
 
== 撤销上次 git commit ==
第6行: 第7行:
 
如果你想把add进去的文件也撤销掉,变成没有add的状态:
 
如果你想把add进去的文件也撤销掉,变成没有add的状态:
 
     git reset <FILE>
 
     git reset <FILE>
 +
 +
== 删除branch ==
 +
删除本地branch:
 +
    git branch -d <branch name>
 +
这个不会对远程的产生影响。只是你push/pull的时候,这个branch不会参与。
 +
 +
如果要删除远程branch: '''注意!注意!危险!'''
 +
    git push origin :<branch name>
 +
这样远端这个branch会被干掉……

2012年4月12日 (四) 20:09的版本

GIT CHEATSHEET! Ref: http://spheredev.org/wiki/Git_for_the_lazy Ref: https://makandracards.com/makandra/topics/version-control

撤销上次 git commit

   git reset --soft HEAD^

如果你想把add进去的文件也撤销掉,变成没有add的状态:

   git reset <FILE>

删除branch

删除本地branch:

   git branch -d <branch name>

这个不会对远程的产生影响。只是你push/pull的时候,这个branch不会参与。

如果要删除远程branch: 注意!注意!危险!

   git push origin :<branch name>

这样远端这个branch会被干掉……