美文网首页
【CMD|GIT】将本地仓库和远程仓库链接

【CMD|GIT】将本地仓库和远程仓库链接

作者: 盐果儿 | 来源:发表于2024-01-29 19:54 被阅读0次

情况一:

先在本地新建了仓库,需要提交到远程仓库。

1. 连接本地仓库和远程仓库。

git remote add origin <repository url>

2. 正常提交

git add .

git commit -m "<comment>"

git push origin main


情况二:

先在 github 上新建了仓库,然后在本地修改。

1. 克隆远程仓库

git clone <repository url>

2. 本地修改

3. 正常提交

git add .

git commit -m "<comment>"

git push origin main

相关文章

网友评论

      本文标题:【CMD|GIT】将本地仓库和远程仓库链接

      本文链接:https://www.haomeiwen.com/subject/rwxnodtx.html