git如何push到远程分支

## 2 Push

### 2.1 Before you push

Before you add your files to local git lib , you should `update your git lib on master branch` from the github remote first.

Firstly, you should let you git lib switch to branch `master`.

git checkout master

Secondly, update the `master`.

git pull origin your-remote-branch:master

If you got some `confilicts` in pull, try to resolve it by your self, or contact to other developers.

### 2.2 Add Commit Merge

After `pull`(also their this no confilict in master), switch to your `my-dev` branch.

git checkout my-dev

Add you files from local framework to git lib in the same place, check your files for safe.

git status

After `check` the changes or add or delete, you should `add -A` and `commit`.

git add -A
git commit -m "write you commit msg here"

After `commit`, switch to master and merge.

git checkout master
git merge my-dev

If you got some `confilicts` in merge, try to resolve it by your self, or contact to other developers.

### 2.3 Push

Finallyyyyyyy, you can push, just try it easy.

git push origin master:your-remote-branch

All done.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值