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 "[email protected]"

创建 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
相关推荐
Cynthia-石头3 小时前
Git Github Gitee GitLab
git·gitee·github
march of Time17 小时前
go的工具库:github.com/expr-lang/expr
开发语言·golang·github
ak啊17 小时前
Git 撤销操作完全指南:从工作区到远程仓库的救赎之路
git
遇见火星18 小时前
【运维实战】Rsync将一台主Web服务器上的文件和目录同步到另一台备份服务器!
运维·服务器·github·rsync
小_路19 小时前
git 常用命令
git
独立开阀者_FwtCoder20 小时前
11 个 JavaScript 杀手脚本,用于自动执行日常任务
前端·javascript·github
shut up21 小时前
Git的使用技巧
gitee·github·shell
NON-JUDGMENTAL1 天前
从零开始,学会上传,更新,维护github仓库
github
Dontla1 天前
git引用概念(git reference,git ref)(简化对复杂SHA-1哈希值的管理)(分支引用、标签引用、HEAD引用、远程引用、特殊引用)
git·算法·哈希算法
独立开阀者_FwtCoder1 天前
使用这个新的 ECMAScript 运算符告别 Try/Catch!
前端·javascript·github