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"。

原文地址:https://www.cnblogs.com/guchunli/p/6364969.html