网站首页 > 技术文章 正文
git 配置 命令行指引
命令行指引
您还可以按照以下说明从计算机中上传现有文件。
Git 全局设置
git config --global user.name "蒙仕业"
git config --global user.email "mengsy@bwoil.com"
创建一个新仓库
git clone http://192.168.102.84:10080/mengsy/frontend.git
cd frontend
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master
推送现有文件夹
cd existing_folder
git init
git remote add origin http://192.168.102.84:10080/mengsy/frontend.git
git add .
git commit -m "Initial commit"
git push -u origin master
推送现有的 Git 仓库
cd existing_repo
git remote rename origin old-origin
git remote add origin http://192.168.102.84:10080/mengsy/frontend.git
git push -u origin --all
git push -u origin --tags
##仓库为空
#参考命令
1. git提交分支相关
在本地新建分支,保证和远程分支一样
git checkout -b 分支名
如果分支已存在,只需要切换的话
git checkout 分支名
提交前先把代码拉下来更新一下,确保不会覆盖别人的代码
git pull origin 远程分支
(如果有)解决冲突
git diff // 然后查看冲突的原因
查看git状态(哪些还未提交)
git status
提交到缓存区
git add .
提交到本地仓库
git commit -m '我这次提交是为了干啥'
提交到远程仓库(线上仓库)
git push origin 分支名
##如dev分支处理
##仓库此时已经有dev分支
猜你喜欢
- 2024-11-07 Git基本操作流程(git 基本操作)
- 2024-11-07 Git 应该用 fetch 还是 pull(git push和fetch)
- 2024-11-07 git 常用命令(git常用命令详解)
- 2024-11-07 git基本用法(git常用)
- 2024-11-07 Git fetch和git pull的区别(git fetch git pull)
- 2024-11-07 【干货】常用的Git命令有哪些?(git常用操作命令 简书)
- 2024-11-07 git常用命令(git常用命令提交)
- 2024-11-07 git 提交代码的简单指令(git提交代码步骤图解merge)
- 2024-11-07 工作流一目了然,看小姐姐用动图展示10大Git命令
- 2024-11-07 说说Git常用的命令有哪些?(git 常用)
- 最近发表
- 标签列表
-
- cmd/c (90)
- c++中::是什么意思 (84)
- 标签用于 (71)
- 主键只能有一个吗 (77)
- c#console.writeline不显示 (95)
- pythoncase语句 (88)
- es6includes (74)
- sqlset (76)
- apt-getinstall-y (100)
- node_modules怎么生成 (87)
- chromepost (71)
- flexdirection (73)
- c++int转char (80)
- mysqlany_value (79)
- static函数和普通函数 (84)
- el-date-picker开始日期早于结束日期 (76)
- js判断是否是json字符串 (75)
- asynccallback (71)
- localstorage.removeitem (74)
- vector线程安全吗 (70)
- java (73)
- js数组插入 (83)
- mac安装java (72)
- 查看mysql是否启动 (70)
- 无效的列索引 (74)