- git初始化:git init
- 创建用户名和邮箱,配置SSH:git用户邮箱创建及SSH配置
- 配置好密钥后,连接远程服务器:git remote add origin +url(此处的url我用的http)。另外,如果需要切换连接,使用命令git remote rm origin 删除关联库,再重新连接其他库即可。
- 文件上传至本地:git add +文件名;或git add . (上传全部)
- 提交至仓库:git commit -m "xxx",xxx为注释内容
- 上传至服务器:git push -u origin master 如果出现下图报错,则使用git push -f origin master 命令。
- 注意,如果出现下述关于ssh的异常提示:
Unable to negotiate with 10.41.2.250 port 29418: no matching host key type found. Their offer: ssh-rsa,ssh-dss fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
上传项目至GitBlit
于 2024-02-22 17:25:06 首次发布