项目上传到git服务器

假设已经在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

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容