git使用简明教程

1.自己在gitlab.XXX.com创建一个项目

点击右上角的“+”符号,创建新项目。

项目名:xxxtest

 

2.在master分支提交一个文件Readme.txt

文件内容:

Date: 2016-07-xx

Author: xxxx@XXX.com

说明: homework

git clone ssh://XXX

git add Readme.txt

git commit -m 'add readme.txt'

#此处master为分支名

git push origin master

 

3.新建分支testing,并推送到gitlab

git branch testing

git checkout testing

#此处testing为分支名

git push origin testing

 

删除分支操作方式如下:

#新建origin分支

git branch origin

#删除origin分支

git branch -d origin

 

4.在testing提交文件夹“dir”, 文件夹里须有文件“file1”

mkdir dir

cd dir

touch file1

cd ..

git add ./dir

git commit -m 'add dir'

git push origin testing

 

5.将testing分支merge到master分支

git checkout master

git merge testing

git commit -m 'merge testing'

git push origin master

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值