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 首页一片绿吗?今天拿她玩玩自动化提交代 ...
随机推荐
- 深入理解Java中的同步静态方法和synchronized(class)代码块的类锁
一.回顾学习内容 在前面几篇博客中我我们已经理解了synchronized对象锁.对象锁的重入.synchronized方法块.synchronized非本对象的代码块, 链接:https://www ...
- [cf1038E][欧拉路]
http://codeforces.com/contest/1038/problem/E E. Maximum Matching time limit per test 2 seconds memor ...
- 基于python的unittest测试框架集成到jenkins(Mac)
1.jenkins部分 1.1 安装jenkins jenkins下载地址:https://jenkins.io/download/ 安装步骤,疯狂点击下一步 1.2 打开jenkins服务 在浏览器 ...
- 【mongodb】如何在mac上安装mongoDB
1.登入MongoDB的官网 选择发布的版本 网址:https://www.mongodb.com/download-center/community 2.下载tgz的包,解压缩 3.打开终端,配置环 ...
- C# 以共享只读方式打开被其它程序占用的文件
iStream = new System.IO.FileStream(filepath, System.IO.FileMode.Open, System.IO.FileAccess.Read, Sys ...
- SQL Server 幻读 的真实案例
数据库中有表[01_SubjectiveScoreInfo],要实现表中的数据只被查出一次,此表数据量较大,有三四百万数据.表结构也确实不是很合理,无法修改表结构,即使是新增一个字段也会有相当大的修改 ...
- linux 保留文件 其余删除
set选项与shopt选项是两组不同的内容,用set -o和shopt -p可以分别查看两个组所有的打开和关闭的条目, 在默认状态下,有些是打开的,有些是关闭的,shopt各选项随着bash版本的更新 ...
- JS 点击复制
一.原理分析 浏览器提供了 copy 命令 ,可以复制选中的内容 document.execCommand("copy") 如果是输入框,可以通过 select() 方法,选中输入 ...
- 虚拟机安装及配置(centOs7)
准备工作 a)下载VMware workstation14 b)下载CentOS7 CentOS7 c)下载xshell.xftp 安装参考 分区设置 补充(解决网络IP问题,设置IP,service ...
- 我发起并创立了一个 C 语言编译器 开源项目 InnerC
本文是 VMBC / D# 项目 的 系列文章, 有关 VMBC / D# , 见 <我发起并创立了一个 VMBC 的 子项目 D#>(以下简称 <D#>) https: ...