参考:gitee上传 | 更新代码
git clone指定分支
gitee简单使用教程
Research
在虚拟机中进行git配置的相关设置
1.1 初次上传
2种方式:
1)先在本地git clone
一个分支,然后修改更新
git clone <https地址>
# 如果要指定branch
git clone -b <指定branch名称> <https地址>
# 私有库要输入
git config --global user.name "username"
git config --global user.email "mail"
# 更新库
git add . #将当前目录所有文件添加到git暂存区
# 如果只更新部分文件
git add <路径+文件>
git commit -m "my first commit" #提交并备注提交信息
git push origin master #将本地提交推送到远程仓库
# 或使用 git push -u origin main
2)重新初始化,然后修改更新
git init <自定义库名称,可以省略>
git remote add origin <https地址>
git pull origin master # 不一定执行
git add <路径+文件>
git commit -m "my first commit" #提交并备注提交信息
git push origin master #将本地提交推送到远程仓库
1.2 其他操作
# 该分支名称
git branch -M <自定义名称>
# 上传权限问题
# 【https://blog.csdn.net/qq_42592823/article/details/123913963】
# 问题:gnutls_handshake() failed: Error in the pull function.
# 参考【https://blog.csdn.net/weixin_39132520/article/details/114924970】
# 选择第三种方法,下载安装openssl_1.1.1-1ubuntu2.1_18.04.20_amd64.deb
# 删除分支
git remote rm origin
# 查看branch
git branch -a # 带*是当前分支
# 切换branch
git checkout <branch name>
# 关联远程branch
git remote add origin https://github.com/yiliaLuo/FVIO-ORB_SLAM3.git
# 提交branch
git push origin <local_branch_name>:<remote_branch_name>
版权声明:本文为warningm_dm原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。