@@ -7,7 +7,7 @@ Say you want to contribute changes to someone else's repository (eg,
77[ this one] ( http://github.com/kbroman/github_tutorial ) ).
88
99- Go to the repository on github. (Say it's by ` myfriend ` , and is
10- called ` the_repo ` , then you'll find it at ` http://github.com/myfriend/the_repo ` .
10+ called ` the_repo ` , then you'll find it at ` http://github.com/myfriend/the_repo ` .)
1111
1212- Click the &ldquo ; Fork&rdquo ; button at the top right.
1313
@@ -41,7 +41,7 @@ Say you want to contribute changes to someone else's repository (eg,
4141
4242- Go to _your version_ of the repository on github.
4343
44- - Click “Pull Request” button at the top.
44+ - Click the “Pull Request” button at the top.
4545
4646- Note that your friend's repository will be on the left and _your
4747 repository_ will be on the right.
6565Now push them back to your github repository.
6666
6767 $ git push
68+
69+
70+ ### Handling pull requests
71+
72+ Say your friend has suggested some changes to your code.
73+
74+ Ask them to [get a github account](first_use.html) and follow the
75+ instructions above: fork your
76+ repository, make the changes, and submit a pull request.
77+
78+ Once they do that, you'll get an email about it. How to handle it?
79+
80+ #### Using the github website:
81+
82+ - Go to your version of the repository.
83+
84+ - Click on “Pull Requests” at the top.
85+
86+ - Click on the particular request.
87+
88+ - You'll see their comments on the pull request, and can click to see
89+ the exact changes.
90+
91+ - If you want them to make further changes before you merge
92+ the changes into your repository, add a comment.
93+
94+ - If you hate the whole idea, just click the “Close”
95+ button.
96+
97+ - If you want to merge the changes into your repository, click the
98+ “Merge pull request” button.
99+
100+ - Your github repository will now be fixed, but you'll want to get
101+ them into your local repository, too.
102+
103+ - Open a terminal/shell, and type
104+
105+ ````
106+ $ git pull
107+ ````
108+
109+ #### Using the command line
110+
111+ You don't have to use the github website for this.
112+
113+ - Open a terminal/shell.
114+
115+ - Go into the directory for your project.
116+
117+ - Add a connection to your friend's version of the github repository,
118+ if you haven't already.
119+
120+ ````
121+ $ git remote add mycollaborator git://github.com/mycollaborator/scratch_repo.git
122+ ````
123+
124+ - Pull his/her changes.
125+
126+ ````
127+ $ git pull mycollaborator master
128+ ````
129+
130+ - Push them back to your github repository.
131+
132+ ````
133+ $ git push
134+ ````
135+
136+ - The pull request on github will be automatically closed.
0 commit comments