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 提交代码的更多相关文章

  1. 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命令行 ...

  2. # .NET Core下操作Git,自动提交代码到

    .NET Core下操作Git,自动提交代码到 转自博客园(阿星Plus) .NET Core 3.0 预览版发布已经好些时日了,博客园也已将其用于生产环境中,可见 .NET Core 日趋成熟 回归 ...

  3. git私有仓库提交代码

    #首次提交 #克隆版本库到本地 git clone http://192.168.3.107:9002/develop/zhong.git cd zhong #创建忽略文件(忽略文件自行编辑) tou ...

  4. git学习心得之git跨分支提交代码

    最近在工作中遇到了git跨分支提交代码的问题,本地拉的是远程master分支的代码,需要将本地修改代码提交到远程temp分支. 1.在gitlab上对相应项目fork本地分支 2.更新本地代码,将远程 ...

  5. 如何向git账号上提交代码

    官方说明:https://help.github.com/articles/generating-ssh-keys/ 1,为Github账户设置SSH key 文章地址:http://zuyunfei ...

  6. git使用,提交代码简记

    强制覆盖本地修改:git reset --hard 项目初始时获取前端代码: git clone https://git.oschina.net/yudian/yudian-frontend.git ...

  7. git gitlab 使用 提交代码解决冲突

    1.更改完代码后,git push 发生错误 注: 此时,使用 git pull: 更新代码,git 会自动merge不同的更新, a.  如果git 自动merge成功,再进行 git push操作 ...

  8. 通过Git向Github提交代码(Windows系统)

    1.新建项目 在GitHub选择并创建一个项目.首先,登录 GitHub,单击页面右上角加号“+” ,选择“New repository” 选项. 填写项目名称及描述,默认项目为“Public”,如果 ...

  9. .NET Core下操作Git,自动提交代码到 GitHub

    .NET Core 3.0 预览版发布已经好些时日了,博客园也已将其用于生产环境中,可见 .NET Core 日趋成熟 回归正题,你想盖大楼吗?想 GitHub 首页一片绿吗?今天拿她玩玩自动化提交代 ...

随机推荐

  1. erlang-gb_tree,gb_set

    gb_tree, gb_set, 均为一个二叉树.具体怎么实现,这边不在累赘,官方有手册, how to use ? 才是我们的重点 1. 初始化 1> gb_trees:empty().{0, ...

  2. Linux命令学习之路-文档浏览之less

    使用权限:所有角色 使用方式:less [ options ] filename 作用:文档内容浏览,可向前或者向后浏览文档内容 注意点: 1.less 命令和 more 命令的作用大致相同,less ...

  3. web.html

    在“Web页”节点下,展开WEB-INF节点,然后双击web.xml文件进行查看. web.xml文件包含Facelets应用程序所需的几个元素.使用NetBeans IDE创建应用程序时,将自动创建 ...

  4. 《Linux内核原理与分析》第三周作业

    实验:基于kernel的简单的时间片轮转多道程序内核 1.实验要求 完成一个简单的时间片轮转多道程序内核代码 2.实验过程 进入实验楼的linux环境,打开shell,输入以下代码: cd Linux ...

  5. zombodb 几点说明

    内容来自官方文档,截取部分 默认es 索引的副本为0 这个参考可以通过修改索引,或者在创建的时候通过with 参数指定,或者通过pg 的配置文件中指定 索引更多的列以为这使用了更多的es 能力 索引的 ...

  6. bootstrap modal 移除数据

    有时业务需求,在弹出模态框时需要动态的展示,但是不做处理时,每次弹出的都是第一次的数据,所以需要监听模态框关闭,每次关闭需要先清除里面的数据. //监听弹页关闭 $("#myModal&qu ...

  7. MySQL:System.Data.Entity ,MySqlCommand, MySqlParameter and "LIKE" %

    Introduction Using GetSqlStringCommand with a text comparative, with LIKE, in ADO.NET and the MySQLP ...

  8. MySql开启远程账户登陆总结

    1.更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"127.0.0.1"改成"% ...

  9. Android中的Sqlite中的onCreate方法和onUpgrade方法的执行时机

    1.今天在做数据库升级的时候,遇到一个问题,就是onCreate方法和onUpgrade方法的执行时机的问题,这个当时在操作的时候,没有弄清楚,很是迷糊,后来看了相关的博客由于转发受限所以copy了一 ...

  10. C++Primer第五版——习题答案详解(十一)

    习题答案目录:https://www.cnblogs.com/Mered1th/p/10485695.html 第12章 动态内存 练习12.1 b1包含4个元素,b2被销毁 练习12.2 #incl ...