$ sudo apt-get install
git
$
git
config --global user.name \"Han XiaoTong\"
$
git
config --global user.email \"hanxiaotongtong@163.com\"
hanxt@hanxt-Satellite-L700 ~ $ git config --list
user.name=Han
Xiaotong
user.email=hanxiaotongtong@163.com
用git管理哪个项目就到该项目下面执行以下命令初始化: git init git add README
$ git clone git://github.com/schacon/grit.git
$ git clone git://github.com/schacon/grit.git mygrit
$ git status
$ git add <FILE_NAME>
# 此为注释 – 将被 Git 忽略
*.a # 忽略所有 .a 结尾的文件
!lib.a # 但 lib.a 除外
/TODO # 仅仅忽略项目根目录下的 TODO 文件,不包括 subdir/TODO
build/
# 忽略 build/ 目录下的所有文件
doc/*.txt # 会忽略 doc/notes.txt 但不包括 doc/server/arch.txt
$ git commit -m \'some comment\'
$ git commit -a -m \'some comment\'
$ git rm grit.gemspec
$ git rm --cached readme.txt
$ git rm log/*.log
如果刚才提交时忘了暂存某些修改,可以先补上暂存操作,然后再运行 –amend 提交
$ git commit -m \'initial commit\'
$ git add forgotten_file
$ git commit --amend
$ git reset HEAD <FILE_NAME>
$ git checkout -- <FILE_NAME>
喜欢 (2)or分享 (0)