git: 本地项目连接远程 remote/github
本地已经创建好了项目,连接远程github
步骤
- 创建本地项目,如果没有 git 则运行 git init
- 获取远程 github 的ssh url(或者 https)
- 执行命令 git remote add
- 推送远程: git push orgin
# git
git init
# remote
git remote add origin git@github.com:aric-swift/Landmarks.git
# push to main
git push -u origin main
确认 git/config
[remote "origin"]
url = git@github.com:aric-swift/Landmarks.git
fetch = +refs/heads/*:refs/remotes/origin/*