Git实现GitHub或Bitbucket文件修改流程

follow this rule to use a repo github/bitbucket in order to avoid code pull/request conflict issue

Fork your own repository at https://bitbucket.xxx

# Click “Clone” button to get your own HTTP addresson the fork repository webpage

#Clone the repository to your local PC, onlydo once.

$git clone https://ooxx(replace with you own address)

 

#Setup a new branch named dev_master,only do once.

$git checkout master

$git pull origin master

$git checkout -b dev_master

 

# Working on dev_masterbranch

# Do these steps when you make code changes everytime

$git checkout master

$git pull origin master

$git checkout dev_master

$git merge master

$git add filename or git add .

$git commit -s -m “comment”

$git push origin dev_master:dev_master

#Pull request your change

Navigateto bitbucket webpage, Do pull request from your fork repository’s dev_master branch to team formal repository’s masterbranch

 

#if you pull request is rejected and will not be merged anymore, you shoulddiscard the dev_master branch

#Create a new branch such as dev_master2,only do once

$git checkout master

$git pull origin master

$git checkout -b dev_master2

 

# Working on dev_master2branch

# Same as above part, just replace dev_master with dev_master2

 

Command explain:

gitcheckout XXX : swith to XXX branch as your current branch

gitpull origin master: fetch from origin master branch and merge it to yourcurrent branch

gitcheckout -b XXX: create XXX branch and switch to it

gitmerge XXX: merge XXX branch to current branch

 

gitadd: add files to commit pool for next commit.

gitrm: remove files from commit pool for next commit.

gitmv: rename file or move location for next commit.

 

gitpush origin XXX:XXX : push and merge local XXX branch to remote XXX branch

https://blog.csdn.net/da_caoyuan/article/details/52649829

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值