Git
1. 安装
添加SSH Key
Push an existing repository from the command line
git remote add origin https://github.com/chunkai-meng/symfony.git
git push -u origin master
git config credential.helper store
2. 使用
Permanently ignore changes to a file
If a file is already tracked by Git, adding that file to your .gitignore is not enough to ignore changes to the file. You also need to remove the information about the file from Git's index:
These steps will not delete the file from your system. They just tell Git to ignore future updates to the file.
Add the file in your .gitignore.
Run the following:
> git rm --cached <file>
Commit the removal of the file and the updated .gitignore to your repo.
3. 技法
书写Commit Message的原则
- 首行是少于50字标题,首字母大写,末尾没有句号.
- ~/.vimrc 加入
autocmd Filetype gitcommit setlocal spell textwidth=72
- TITLE:标题用命令式语气,表明采用了本次commit以后会发生什么(e.g. "Add auth to X")
- 留空一行写Body,用小于72个字符,描述what and why vs. how。
- BODY:解释这次 commit 的目的(产生的影响,甚至副作用)。至于how(如何产生)不重要,代码已经解释了
网友评论