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
相关推荐
m0_6948455710 小时前
tinylisp 是什么?超轻量 Lisp 解释器编译与运行教程
服务器·开发语言·云计算·github·lisp
June`11 小时前
muduo项目排查错误+测试
linux·c++·github·muduo网络库
春日见11 小时前
如何创建一个PR
运维·开发语言·windows·git·docker·容器
weixin_66813 小时前
GitHub 2026年AI项目详细数据汇总表-AI分析-分享
人工智能·github
CoderJia程序员甲1 天前
GitHub 热榜项目 - 日榜(2026-02-05)
ai·开源·大模型·github·ai教程
stevenzqzq1 天前
git 常用操作
大数据·git
weixin_6681 天前
GitHub 2026年AI项目热度分析报告-AI分析-分享
人工智能·github
Curvatureflight1 天前
Git工作流最佳实践:从混乱到优雅
git
MicrosoftReactor1 天前
技术速递|GitHub Copilot CLI 斜杠命令速查表
github·copilot·cli
wu~9701 天前
GitHub永不遗忘,使用git push -f来覆盖的提交依旧保留
git·github