git使用命令总结

文章目录

Git 复制

css 复制代码
git clone  -b RobotModelSetting/develop https://gitlab.123/PROJECT/123.git

创建提交步骤

Git 全局设置:

css 复制代码
git config --global user.name "jiyuchen"
git config --global user.email "674680916@qq.com"

创建 git 仓库:

css 复制代码
mkdir boxcutter-gui
cd boxcutter-gui
git init 
touch README.md
git add README.md
Code
git remote add origin https://gitee.com/jiyuchen/boxcutter-gui.git
git push -u origin "master"

已有仓库?

css 复制代码
cd existing_git_repo
git remote add origin https://gitee.com/jiyuchen/boxcutter-gui.git
git push -u origin "master"

遇到问题解决办法:

问题一

先git pull一下,具体流程为以下几步:

css 复制代码
$ git pull origin 远程分支名
$ git push origin 远程分支名

详细步骤

css 复制代码
1、右击git项目(里面添加.git文件夹) git bash here
在每次 push 代码之前先把服务器上最新的代码 pull 到本地。
2、git pull origin master --allow-unrelated-histories
3、git pull origin master
4、git init
5、git remote rm origin(如果没有这一步直接下一步会提示错误fatal: remote origin already exists.)
6、git remote add origin  (https地址)
7、git add .
8、git commit -m 'testst'
9、git push -u origin master
相关推荐
Lcr3s2 小时前
Git基础之(0):如何在Ubuntu(Linux)上安装git
git
子林super3 小时前
顺序表用Python3定义与增删改查
github
子林super3 小时前
Python非空判断与类型检查写法
github
子林super3 小时前
Python list与array关键区别及使用场景
github
子林super3 小时前
Python中None与null的区别
github
u1301305 小时前
GitHub 热榜项目:周榜(2026-09-20)
人工智能·github
u1301306 小时前
GitHub 热榜项目:日榜(2026-09-20)
人工智能·github
逛逛GitHub7 小时前
外网 3500 万人围观的 Jev 模型,有这 10 个神奇玩法。
github
子非鱼eva7 小时前
昇腾开源仓Issue分析解答-mindspore精选(三)·主仓与mindformers长尾收官
人工智能·ai·gitcode
m4Rk_7 小时前
【论文阅读】Agent 记忆机制(76):SEEM——从碎片检索到完整事件重建
论文阅读·人工智能·学习·开源·github