This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
在commit changes下面的文本框中,填入fix #n(n是issues号,前面信息任写,作为这次修改的一个说明) | |
另外,下面几个也可以: | |
fixes #n | |
fixed #n | |
close #n | |
closes #n | |
closed #n | |
个人首选fix #n | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 快照snapshot 是某个时刻的所有文件,其中,有所有被修改文件的本身和指向未修改文件的指针 | |
git之所以快,就是因为它时刻都在本地保持了全部文件。 | |
2 工作区,暂存区和数据库是本地的三个区域。其中,数据库存放了所有文件,工作区存放的是修改了的文件,而暂存区则存放的是索引,被修改文件的索引,应该是指向工作区。 | |
3 工作机制:修改文件时,将文件从数据库弄到工作区修改。修改后要添加到暂存区,添加的只是一个索引,指向工作区中相应的位置,然后可以提交到数据库中。 | |
4 添加到暂存区用的命令是git add,提交用的是git commit | |
5 如果一个文件被修改,其状态转换成已修改(系统会监督),之后用git add可以添加到暂存区,最后用git commit提交到数据库。 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
其实这个快照是三个部分的合成:数据库、工作区和暂存区。 | |
它们构成了数据的全貌。 | |
没有改的文件在数据库,改了的文件在工作区,而暂存区存放有指向它们的链接。 | |
说明一个问题:当修改文件时,文件从数据库移动到了工作区,但是只是一个副本。 | |
改完了,要执行git add,数据库中的文件才会消失。 | |
这时,由暂存区的链接和工作区的被修改了的文件,构成了对这个文件的跟踪。 | |
就是说,数据库始终放的是 没有修改的文件。 | |
执行git commit后,被修改的文件放到了数据库,暂存区的相关链接消失,工作区相关文件消失。 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/huangblue/codeparkshare 将fork的项目克隆到本地 | |
git remote add codeparkshare https://github.com/Yixiaohan/codeparkshare 添加远程仓库(fork的原仓库) | |
git commit 提交本地变更 | |
git remote update 更新原仓库 | |
git checkout master 检出本地分支 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
跳过git add | |
可能这个a是这么来的。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
它是要从物理上删除文件 | |
如果不想删除,只想不被跟踪,加参数--cached | |
例如: git rm --cached README | |
最后是文件名。 | |
这样,就把文件从监视目录去掉。 | |
以后再用命令 git rm是不可以删除它的。 | |
这说明,git rm只针对进入数据库系统中的 | |
可以物理上存在的文件理解为两部分:一部分是被监视的,一部分是不被监视的。 | |
可以通过git add把不被监视的加入进到被监视的部分。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git commit -m 'initial commit' | |
它会使用后面参数指定的文字。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git fetch命令是从远程取数据,但是存放到.git目录中。通过观察.git的容量得到的结论。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone 自动添加了远程仓库,命名为origin | |
git fetch 拉取到本地仓库(.git),并不合并。以后需要手工合并 | |
git pull 自动合并远程分支到本地分支 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
有两个因素会影响他们的长期成功,某些毕业生会格外成功,一是他们不断地提问,二是他们相信自己。 |
OlderNewer