这里写目录标题
在本地库关联git仓库
如果已经关联过其他的代码仓库,会出现:
base) root@node05:~/deep_learning/SMARTS/SMARTS# git remote add origin https://github.com/xxxxx/xxxxx.git
fatal: remote origin already exists.
先查看已经关联的代码仓库:
(base) root@node05:~/deep_learning/SMARTS/SMARTS# git remote -v
origin https://github.com/huawei-noah/SMARTS.git (fetch)
origin https://github.com/huawei-noah/SMARTS.git (push)
先删除关联
(base) root@node05:~/deep_learning/SMARTS/SMARTS# git remote rm origin
再重新建立关联
base) root@node05:~/deep_learning/SMARTS/SMARTS# git remote add origin https://github.com/xxxxx/xxxxx.git
上传代码
选择分支
git branch -M main
添加文件到缓存区
git add .
查看状态
git status
显示是绿色的就没有问题
提交一下 xx为描述
git commit -m "xx"
上传代码
git push -u origin main