30 | 注册一个GitHub账号
31 | 配置公私钥
参考官方文档:https://help.github.com/
Using the SSH protocol, you can connect and authenticate to remote servers and services. With SSH keys, you can connect to GitHub without supplying your username or password at each visit.
32 | 在GitHub上创建个人仓库
image.pngtips
- Checking for existing SSH keys
Enter ls -al ~/.ssh to see if existing SSH keys are present:
ls -al ~/.ssh
# Lists the files in your .ssh directory, if they exist
33 | 把本地仓库同步到GitHub
- 本地建立remote
git remote add github git@github.com:Allen1218/git_learnning.git - push所有分支
git push github --all - 从远端获取
git fetch github master - merge
git merge --allow-unrelated-histories github/maste
git fetch 相当于是从远程获取最新到本地,不会自动merge git pull:相当于是从远程获取最新版本并merge到本地, 在实际使用中,git fetch更安全一些 【参考https://blog.csdn.net/riddle1981/article/details/74938111】
网友评论