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
相关推荐
miofly34 分钟前
Anthropic为Claude四款模型加水印,两款旧模型留调参漏洞
开源·github
m4Rk_35 分钟前
【论文阅读】Agent 记忆机制(116):Hybrid Memory——用互补策展与离线巩固构建长期记忆
论文阅读·人工智能·学习·开源·github
u1301303 小时前
GitHub 热榜项目:日榜(2026-10-31)
github
-梅3 小时前
GitHub Actions 自动化:5 个真实运维提效案例
运维·自动化·github
miofly4 小时前
GitHub 周榜趋势速报 | 2026-11-01
开源·github
miofly4 小时前
GitHub 日榜趋势速报 | 2026-11-01
开源·github
Sakura_j_h_13 小时前
EasyEDA PCB 快速设计Skills
c++·python·github
BIBI204914 小时前
换 Git 托管平台怎么做?基于 TortoiseGit 的跨平台迁移教程
windows·git·tortoisegit·问题解决·版本控制·最佳实践
wflynn16 小时前
GitHub 今日推荐|Edge0:让大号 MoE 模型在一台 Mac 上流式跑起来
python·开源·github
用户别睡觉17 小时前
五大 RAG 开源项目对比 2026:Dify、RAGFlow、FastGPT、AnythingLLM、LightRAG
github