4.5. Making and Approving Pull Requests
Create a Pull Request
Create a new branch and add some changes locally:
$ git
clone https:/github.com/lab-repository/lab-repo.git
$ cd
lab-repo
~/lab-repo$ git
checkout -b new_feature
Switched to a new branch 'new_feature'
~/lab-repo$ git
add hello.c
~/lab-repo$ git commit -m
"Hello world program."
[new_feature f3a4091] Hello world program.
1 file changed, 7 insertions(+)
create mode 100644 hello.c
~/lab-repo$
git add datafile.dat
~/lab-repo$
git commit -m "Fixed error."
[new_feature f2b6fe3] Fixed error.
1 file changed, 2
insertions(+), 1 deletion(-)
Push new branch to GitHub:
~/lab-repo$ git push origin new_feature
Enumerating
objects: 8, done.
Counting objects:
100% (8/8), done.
Delta compression
using up to 16 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (6/6), 703
bytes | 703.00 KiB/s, done.
Total 6
(delta 0), reused 0 (delta 0)
remote:
remote: Create a pull
request for 'new_feature' on GitHub by
visiting:
remote:
https://github/lab-repository/lab-repo/pull/new/new_feature
remote:
To github.com:lab-repository/lab-repo.git
* [new branch]
new_feature ->
new_feature
After pushing your branch, click the link in the terminal or navigate to your repository on GitHub. You will be able to typically see a prompt or button to "Compare & pull request" for your newly pushed branch. Click this, fill in the details (title, description), and then create the pull request through the web interface.