Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2️⃣PR操作步骤 #78

Open
Genluo opened this issue Dec 19, 2019 · 1 comment
Open

2️⃣PR操作步骤 #78

Genluo opened this issue Dec 19, 2019 · 1 comment
Assignees
Labels

Comments

@Genluo
Copy link
Owner

Genluo commented Dec 19, 2019

操作步骤

  • fork项目
  • 本地下载项目并本地关联远程分支
# 首先克隆我们的github项目到本地
git clone [email protected]:我们的github名/developer-note.git

# 关联开源项目,注意这个`upstream`就代表关联上一级仓库,而`origin`表示我们自己的远程库
git remote add upstream [email protected]:BrucePhoebus/developer-note.git
  • 拉取开源项目,保持同步,然后创建开发分支
# 先拉取最新开源项目更新,此时我们在本地master分支
git pull upstream master
# 然后创建我们的开发分支,等同于 git checkout -b dev-20190805
git branch dev-20190805	# 创建分支
git checkout dev-20190805	# 切换到开发分支
# 我们新增完内容就可以提交到我们的远程仓库,注意是我们origin自己github的远程仓库
git push origin dev-20190805
  • 提交Pr(pull request)
  1. 这一步是将我们贡献的内容提交给开源作者,也就是提醒他我做了这个更新,将对应的分支交个他合并到开源项目

  2. 我们到我们github的developer-note项目中,可以看到issue旁边有个Pull request,点击进去我们新建Pull request

  3. 然后我们就在最后边的分支选项中选择我们要提交的分支,选中后检查一下下面内容的变更,然后就可以Create pull request创建PR

  4. 之后我们就能在开源作者的项目中看到一条pull request记录,开源作者会检查(review代码)我们贡献的内容,正常由他合并到开源项目中

仓库秘钥配置

文章参考: Multiple SSH keys for different accounts on Github or Gitlab
SSH

@Genluo Genluo added the 通用 label Dec 19, 2019
@Genluo Genluo self-assigned this Dec 19, 2019
@Genluo Genluo pinned this issue Dec 19, 2019
@Genluo Genluo changed the title 开源操作步骤 2️⃣PR操作步骤 Dec 19, 2019
@Genluo
Copy link
Owner Author

Genluo commented Dec 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant