项目上传到git服务器

2024-11-04  本文已影响0人  MrDemo

假设已经在git服务器上创建完项目
1、打开想要上传项目的根目录,右键git Bash Here
2、git init
3、 git add .
4、 git commit -m "第一次提交"

如果提示:fatal: unsafe repository ('D:/project/MyTest' is owned by someone else)
To add an exception for this directory, call:
那么执行: git config --global --add safe.directory D:/project/MyTest

5、关联连接:git remote add origin http://username:password@192.168.3.188:7777/test/MyTest.git

操作过程中如果提示:error: remote origin already exists.
删除关联: git remote rm origin,在重复上面的操作

6、上传代码: git push -u origin main

上一篇 下一篇

猜你喜欢

热点阅读