git_ask_01-How to fork and contribute?

本文详细介绍了如何在GitHub上通过Fork项目、创建分支、提交更改、发送Pull Request等步骤,为开源项目做出贡献的全过程。同时,还提供了如何同步源项目的最新变更的方法。

ID = git_ask_01

Question

How to fork and contribute?

Answer

Follow the following procedure to make it.

Step1: Fork target project

This is done in Github

Step2: Clone project with your own git address

Go to your own page and copy the address.

$ git clone _your_own_address_

Step3: Cut branch for development

$ git checkout -b dev

Step4: Make all the changes in dev branch

After making all the changes, run the following command

$ git add .
$ git commit -m "description notes"

Step5: Switch to branch ‘master’

$ git checkout master

Step6: Merge with dev

$ git merge dev

Step7: Push to server

$ git pull
$ git push origin master

Step8: New pull request

If there is no conflict, we will find Able to merge in your Github, and then open a new pull request, then the owner will see this and treat it.

Step9: Delete branch ‘dev’

After done, delete the temporal branch ‘dev’

$ git branch -d dev

Extension

Qeustion_ex1

How to synchronize with source project after forked?

Answer_ex1

Add remote branch
For more details, see git_ask_02

Reference

[1] GitHub怎样fork别人代码到自己仓库并进行贡献

[2] 在github上fork项目如何同步并解决冲突

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值