写错了,我们可以撤回
如果我们添加上去了怎么办?一样可以撤回
万一我们提交了?那就按上一篇讲到的,撤回。。。。。。。
下面来看一下删除
接下来我们在git hub申请一个账号,创建一个远程的仓库
git clone https://github.com/ArronSmallWu/Test
创建分支 git branch dev 切换分支git checkout dev
或者是创建和切换一起git checkout -b ak
创建分支并且在分支上进行创建文件和提交,最后回到master发现自己没有变化,那就对了
gec@ubuntu:~/Test$ ls
README.md
gec@ubuntu:~/Test$ git branch
* master
gec@ubuntu:~/Test$ git checkout -b shit
Switched to a new branch 'shit'
gec@ubuntu:~/Test$ git branch
master
* shit
gec@ubuntu:~/Test$ echo "abc" > abc.txt
gec@ubuntu:~/Test$ ls
abc.txt README.md
gec@ubuntu:~/Test$ cat abc.txt
abc
gec@ubuntu:~/Test$ git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
gec@ubuntu:~/Test$ ls
abc.txt README.md
gec@ubuntu:~/Test$ git checkout shit
Switched to branch 'shit'
gec@ubuntu:~/Test$ git add abc.txt
gec@ubuntu:~/Test$ git commit -m "abc"
[shit aa38121] abc
1 file changed, 1 insertion(+)
create mode 100644 abc.txt
gec@ubuntu:~/Test$ git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
gec@ubuntu:~/Test$ ls
README.md
好了,现在可以过河拆桥了,把shit分支合并了,然后删除这分支