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. Ubuntu Server 16.04设置WiFi

    wifi :http://www.cnblogs.com/joeyupdo/p/3350463.html http://blog.csdn.net/meic51/article/details/173 ...

  2. C# 之TripleDESCryptoServiceProvider类加密/解密程序

    这篇博文的编写基于以下博客地址提供的知识: TripleDESCryptoServiceProvider 加密解密 基于该博客,我的毕业设计中密码存储加密字符串这一问题得到解决.

  3. 网络编程 生产者消费者模型 GiL

    守护进程: 注意事项: 1.必须在p.start()前 2.守护进程不能开子进程 3.如果主进程的运行时间快于子进程,那么就只有主进程的结果,没有守护进程的结果,因为守护进程没有进行完.反之会得到两个 ...

  4. centos安装VirtualBox增强包VBoxGuestAdditions

    1.如果你的CentOS 版本早于 6,那么需要在 /etc/grub.conf 中添加一行 divider=10,以将这个参数传递给核心,以减少 idle CPU load.   2.#yum up ...

  5. zabbix的自动发现、自定义添加监控项目、配置邮件告警

    1.zabbix的自动发现这里的自动发现,所显示出来的是规则的上自动了现 然后 可以对其内容进行相关的配制,如时间或周期 注意:对于单个主机的规则,可以自行添加或删除, 但对于已经添加好了的规则,若需 ...

  6. 集群相关、用keepalived配置高可用集群

    1.集群相关 2.keepalived相关 3.用keepalived配置高可用集群 安装:yum install keepalived -y   高可用,主要是针对于服务器硬件或服务器上的应用服务而 ...

  7. 让docker容器开机启动

    网上有些文章说,要让docker 的容器自动在开机启动,是写脚本,比如在 rc.local 中写.其实完全没必要这么麻烦,docker 有相关指令,docker run 指令中加入 --restart ...

  8. k8s-YAML配置文件(转)

    转自http://www.cnblogs.com/bigberg/p/9203619.html 一.YAML基础 YAML是专门用来写配置文件的语言,非常简洁和强大,使用比json更方便.它实质上是一 ...

  9. DataTable.Select 处理关联表数据

    DataSet.Clone  会拷贝表结构,关联关系也会拷贝, 用Select 筛选后ImportRow 导入新的DataTable,然后处理关联DataTable DataSet ds2 = dsS ...

  10. Idea中重建maven模块,dependencies引入为空的解决办法

    使用idea开发Maven项目时, Maven项目中有些模块被删除了,重新加入相同名字的模块时,dependencies为空 如下图 正常引进的项目,dependencies应如下 解决办法: ide ...