git command line 提交代码
echo "# spring-boot-apollo-demo" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/lixyu/spring-boot-apollo-demo.git
git push -u origin master
Command line instructions
Git global setup
git config --global user.name "test"
git config --global user.email "test@os.test.com"
Create a new repository
git clone http://10.138.60.166/lixinyu/boltloan.git
cd boltloan
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master
Existing folder
cd existing_folder
git init
git remote add origin http://10.138.60.166/lixinyu/boltloan.git
git add .
git commit -m "Initial commit"
git push -u origin master
Existing Git repository
cd existing_repo
git remote rename origin old-origin
git remote add origin http://10.138.60.166/lixinyu/boltloan.git
git push -u origin --all
git push -u origin --tags
命令行合并(merge)代码
Step . Fetch and check out the branch for this merge request git fetch origin
git checkout -b release_v20190614 origin/release_v20190614
Step . Review the changes locally Step . Merge the branch and fix any conflicts that come up git checkout release
git merge --no-ff release_v20190614
Step . Push the result of the merge to GitLab git push origin release
附windows下,使用gitlab提交代码完整步骤
1.安装git客户端,并配置环境变量
C:\Program Files\Git\cmd;C:\Program Files\Git\usr\bin;
2.在本机创建ssh-key
#jenkins
ssh-keygen -t rsa -C "jenkins@vcredit.com" -b
3.配置ssh-keys在git服务器上
a)复制密钥
type %userprofile%\.ssh\id_rsa.pub | clip
b)在gitlib服务器上添加密钥
setting->SSH Keys->粘贴密钥到Key->Add key
4.git提交代码示例
示例1
git clone http://10.138.61.75/test/my-test.git
cd my-test
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master
示例2
echo "# spring-boot-apollo-demo" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/lixyu/spring-boot-apollo-demo.git
git push -u origin master
5.How to add your SSH key to Eclipse: https://wiki.eclipse.org/EGit/User_Guide#Eclipse_SSH_Configuration
6.git配置
git config --global user.name "your name"
git config --global user.email "your email"
7.git强制更新并覆盖本地代码
git fetch --all git reset --hard origin/master git pull
8.其他

git command line 提交代码的更多相关文章
- Cordova 3.0 Plugin 安装 及"git" command line tool is not installed
根据http://docs.phonegap.com/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface Windows命令行 ...
- # .NET Core下操作Git,自动提交代码到
.NET Core下操作Git,自动提交代码到 转自博客园(阿星Plus) .NET Core 3.0 预览版发布已经好些时日了,博客园也已将其用于生产环境中,可见 .NET Core 日趋成熟 回归 ...
- git私有仓库提交代码
#首次提交 #克隆版本库到本地 git clone http://192.168.3.107:9002/develop/zhong.git cd zhong #创建忽略文件(忽略文件自行编辑) tou ...
- git学习心得之git跨分支提交代码
最近在工作中遇到了git跨分支提交代码的问题,本地拉的是远程master分支的代码,需要将本地修改代码提交到远程temp分支. 1.在gitlab上对相应项目fork本地分支 2.更新本地代码,将远程 ...
- 如何向git账号上提交代码
官方说明:https://help.github.com/articles/generating-ssh-keys/ 1,为Github账户设置SSH key 文章地址:http://zuyunfei ...
- git使用,提交代码简记
强制覆盖本地修改:git reset --hard 项目初始时获取前端代码: git clone https://git.oschina.net/yudian/yudian-frontend.git ...
- git gitlab 使用 提交代码解决冲突
1.更改完代码后,git push 发生错误 注: 此时,使用 git pull: 更新代码,git 会自动merge不同的更新, a. 如果git 自动merge成功,再进行 git push操作 ...
- 通过Git向Github提交代码(Windows系统)
1.新建项目 在GitHub选择并创建一个项目.首先,登录 GitHub,单击页面右上角加号“+” ,选择“New repository” 选项. 填写项目名称及描述,默认项目为“Public”,如果 ...
- .NET Core下操作Git,自动提交代码到 GitHub
.NET Core 3.0 预览版发布已经好些时日了,博客园也已将其用于生产环境中,可见 .NET Core 日趋成熟 回归正题,你想盖大楼吗?想 GitHub 首页一片绿吗?今天拿她玩玩自动化提交代 ...
随机推荐
- 【转载】 星际争霸2的AI环境搭建
原文地址: https://blog.csdn.net/qq_40244666/article/details/80957644 作者:BOY_IT_IT 来源:CSDN -------------- ...
- js 拷贝clone
array Array.prototype.clone=function(){ return this.slice(0); } 对象 var o = {a: [1]}; //浅拷贝 var o1 = ...
- 框架tensorflow1
TensorFlow 1 分类: 1,protocol Buffer 处理结构化数据工具: (xml,json) 2,Bazel 自动化构建工具, 编译: tensor 张量: ...
- N!分解质因子p的个数_快速求组合数C(n,m)
int f(int n,int p) { ) ; return f(n/p,p) + n/p; } https://www.xuebuyuan.com/2867209.html 求组合数C(n,m)( ...
- LiquiBase 学习
preconditions mysql database is installed maven has been setted up properly add depedenceies apply p ...
- python:Hamlet英文词频统计
#CalHamletV1.py def getText(): #定义函数读取文件 txt = open("hamlet.txt","r").read() txt ...
- solrJ
导入jar包 package com.tzy.solrJ; import java.io.IOException; import org.apache.solr.client.solrj.SolrSe ...
- JVMj机制
- kafka命令大全
kafka命令大全 http://orchome.com/454
- Backbone 学习总结
1.Backbone描述 官网描述:(1)Provides client-side app structure (2)Models to repents data (3)View to hook up ...