码迷,mamicode.com
首页 > 其他好文 > 详细

Basic github workflow

时间:2020-06-05 15:26:03      阅读:84      评论:0      收藏:0      [点我收藏+]

标签:win   accept   The   run   ali   middle   web   folder   Owner   

Reference: 

https://code.tutsplus.com/tutorials/how-to-collaborate-on-github--net-34267

https://guides.github.com/introduction/flow/

After you fork and clone a git repository in a local folder, do the following work-flow

 

1 Adding the upstream remote

cd into the local repository

git remote add upstream git@... (or html copied when cloning the repository)

Then, when running command "git remote", your outcome should like

$ git remote
origin
upstream

This now allow you to pull in changes from the source locally and merge them, like:

git fetch upstream
git merge upstream/master

 

2 Check out a branch, commit and push

Before making your own changes, checkout a new branch. Now commit and push to this new branch

git checkout -b a_new_branch
(...  make your changes )
git commit -am "added welcome"
git push origin a_new_branch

 When you create a branch, you are creating an environment where you can try out new ideas. Anything in master must be deployable, yet in branches you can try out freely and test your idea. Besides, your branch name should be specific (e.g. make-reina-avatars)

 

3 Create a Pull Request

A pull request is like saying to the owner "Hello, I bettered the program and hopefully you can accept these changes"

You can choose the "New pull request" besides the "Branch: master"(or whatever other branches) tag and choose the branch you wanna merge. 

技术图片

 Then in this page, choose your branch and fill in the blank of your modification. Then let‘s create a pull request. Note that you can check the difference in the bootom of the web page. 

技术图片

技术图片

 

4 Merge pull request

After code review and discussion, in the "Pull Requests" panel, you can merge the pull requests. 

技术图片

 

Basic github workflow

标签:win   accept   The   run   ali   middle   web   folder   Owner   

原文地址:https://www.cnblogs.com/guesswhoiscoming/p/13046762.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!