关于git的笔记
Contents
gitingore里的东西又会冒出来
stackoverflow上的解释是:
Even if you haven’t tracked the files so far, git seems to be able to “know” about them even after you add them to .gitignore.
下面是解决方法
First commit your current changes, or you will lose them.
Then run the following commands from the top folder of your git repo:
|
|
常用的分支操作
- 查看本地分支
git branch
···· gb - 查看远程分支
git branch -r
···· gb -r - 从当前分支新建一个分支
git checkout -b new_branch
···· gco -b new_branch - 切到一个分支
git checkout a_branch
···· gco a_branch - 删除本地分支(此时应该在另一个分支)
git branch -D a_branch
···· gb -D a_branch - 删除远程分支(就是将一个空的分支推到远程分支)
git push origin :a_branch
···· gp origin :a_branch - 将分支A合并到分支B(此时应该在分支B上执行)
git merge branch_A
···· gm branch_A
Author: Wang He
Origin: http://wanghewanghe.github.io
Link: http://wanghewanghe.github.io/2017/03/16/关于git的笔记/
本文采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可