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. L2-020. 功夫传人*

    L2-020. 功夫传人 参考博客 #include<vector> #include<cstring> #include<algorithm> using nam ...

  2. sql server中case when的用法

    Case具有两种格式.简单Case函数和Case搜索函数. --简单Case函数 CASE sex WHEN '1' THEN '男' WHEN '2' THEN '女' ELSE '其他' END ...

  3. linux 命令失效

    失效的原因 是我在执行命令的时候输入错误了.在网上找了很多的办法都是以下两种方式:  其一:直接在linux命令行界面输入如下,然后回车(导入环境变量,以及shell常见的命令的存放地址):  exp ...

  4. h5 网络断网时,返回上一个页面 demo (与检测网络代码相结合,更直观看到结果)

    页面一: <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8& ...

  5. hdu 1874 畅通工程续 floyed

    裸题 题意:求任意两点之间的最短路径 坑点:测试数据同一条路径有可能出现多次,然后值不一样,注意筛选最小边 #include <iostream> #include <cstdio& ...

  6. SQLMap工具的安装使用

    SQLMap工具介绍: sqlmap是一个开源软件,用于检测和利用数据库漏洞,并提供将恶意代码注入其中的选项. 它是一种渗透测试工具,可自动检测和利用SQL注入漏洞,在终端中提供其用户界面.该软件在命 ...

  7. hello2 源码解析

    在hello2的项目中,采用的是Java servlet  技术来采取对项目的整体框架的搭建.编写另一个greeting的java文件,实现了一个greeting的java类来覆盖url的doGet方 ...

  8. postgresql安装与启动(mac os)

    转自https://blog.csdn.net/kmust20093211/article/details/44359053 --------数据库的安装与创建----------- 安装 brew  ...

  9. 【java多线程】队列系统之说说队列Queue

    转载:http://benjaminwhx.com/2018/05/05/%E8%AF%B4%E8%AF%B4%E9%98%9F%E5%88%97Queue/ 1.简介 Queue(队列):一种特殊的 ...

  10. Docker修改本地镜像与容器的存储位置

    这个方法里将通过软连接来实现. 首先停掉Docker服务: systemctl restart docker或者service docker stop 然后移动整个/var/lib/docker目录到 ...