liangcai
12/29/2015 - 8:41 AM

From https://git-scm.com/book/zh/v1/%E8%B5%B7%E6%AD%A5-%E5%88%9D%E6%AC%A1%E8%BF%90%E8%A1%8C-Git-%E5%89%8D%E7%9A%84%E9%85%8D%E7%BD%AE 忽略文件 ht

要检查已有的配置信息,可以使用 
git config --list
git config --global --list
git config user.name

配置用户信息
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com

gitignore

# 此为注释 – 将被 Git 忽略
*.a       # 忽略所有 .a 结尾的文件
!lib.a    # 但 lib.a 除外
/TODO     # 仅仅忽略项目根目录下的 TODO 文件,不包括 subdir/TODO
build/    # 忽略 build/ 目录下的所有文件
doc/*.txt # 会忽略 doc/notes.txt 但不包括 doc/server/arch.txt


局域网建立git仓库不走
服务器:
git init --bare

本地同名代码文件夹
git init

git remote add origin ssh://servername@serverhosts/path/

git add -A
git commit -m "message"
推送到远程仓库的master分支
git push origin master

git remote show origin