github上使用SSH和gitignore

1.使用SSH

cd ~/.ssh
ssh-keygen -t rsa -C "your email address"
cat ~/.ssh/id_rsa.pub
ssh -T git@github.com  (github)
ssh -T git@git.oschina.net  (oschina)
Welcome to Git@OSC, nickname!

2.gitignore

在github上搜索gitignore,下载压缩包,根据自己的编程语言选择gitignore文件

cd /Users/apple/Desktop/code
git clone git地址
cp gitignore路径 .gitignore
git add .
git commit -m "添加 gitignore"
git push

注意:"cp gitignore路径 .gitignore"一定要加".gitignore"。

posted @ 2017-02-04 14:49  听风gcl  阅读(176)  评论(0编辑  收藏  举报