GitHub - ErikStaats/Notes GitHub Wiki
Changes in GitHub can be reviewed using pull requests. In this example, a change to the version number is made and committed locally.
Edee$ vi README.md
Edee$ git diff
diff --git a/README.md b/README.md
index 7a9866c..ca3c4d5 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# Test
-Version 2.
+Version 3.
This repository is for testing operations on repos.
Edee$ git commit -a
[master d815759] Update to version 3.
1 file changed, 1 insertion(+), 1 deletion(-)
Edee$
Rather than pushing the change in the local master
branch directly to the
remote master
branch, the change is pushed instead to a remote review
branch.
The syntax "master:review
" causes changes in the local master
branch to be
pushed to the remote review
branch. The remote review
branch will be
created.
Edee$ git push origin master:review
Counting objects: 15, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (15/15), 2.14 KiB | 547.00 KiB/s, done.
Total 15 (delta 0), reused 0 (delta 0)
remote:
remote: Create a pull request for 'review' on GitHub by visiting:
remote: https://github.com/ErikStaats/Test/pull/new/review
remote:
To https://github.com/ErikStaats/Test.git
* [new branch] master -> review
Edee$
On the GitHub repo page, an option to "Compare and Pull Request" should be
presented to create a pull request from review
to master
.
Click on "Create pull request" to create the pull request.
The pull request should be created and the pull request page presented. To merge the change
to the master
branch, click "Rebase and merge".
Click "Confirm rebase and merge".
The pull request should now be merged.
Finally, delete the review
branch on the remote repo.
Edee$ git push --delete origin review
To https://github.com/ErikStaats/Test.git
- [deleted] review
Edee$