本地上传到github

1.首先在github帐号中新建repositories

2.在本地电脑使用ssh-keygen -t rsa -C "[email protected]" 得到id_ras.pub

3.打开文件,复制,之后在github - Account - Settings - ssh中粘贴key



4.进入要上传的文件夹

git config --global user.name "hlang8160"

git config --global user.email "[email protected]"

echo "# Python_Interview" >> README.md

git init

git add README.md

git add .

git remote add origin https://github.com/hlang8160/Python_Interview.git

git commit -m "first commit"

git push -u origin master

git pull

总结:

第一次上传代码时,需要首先设置ssh key复制到github setting中.之后再在本地设置global user.name 和global user.email

以后每次使用不用重复设置.

可以直接进入第4步


猜你喜欢

转载自blog.csdn.net/hlang8160/article/details/80722458