OSDN Git Service

[llvm][docs] Add step by step git to GettingStarted
authorZola Bridges <zbrid@google.com>
Sun, 17 May 2020 17:11:26 +0000 (10:11 -0700)
committerZola Bridges <zbrid@google.com>
Tue, 19 May 2020 19:14:17 +0000 (12:14 -0700)
Summary:
Due to deleting the git llvm script, folks were asking for better documentation
about how to use git in order to commit to the Github repo. I added some step
by step git commands to make the usage clearer.

link: http://lists.llvm.org/pipermail/llvm-dev/2020-May/141640.html
Reviewed By: spatel, mehdi_amini

Differential Revision: https://reviews.llvm.org/D80088

llvm/docs/GettingStarted.rst

index fbcb7aa..46e337d 100644 (file)
@@ -496,10 +496,28 @@ required access rights. See `committing a change
 `obtaining commit access <DeveloperPolicy.html#obtaining-commit-access>`_
 for commit access.
 
+Here is an example workflow using git. This workflow assumes you have an
+accepted commit on the branch named `branch-with-change`.
+
+.. code-block:: console
+
+  # Go to the branch with your accepted commit.
+  % git checkout branch-with-change
+  # Rebase your change onto the latest commits on Github.
+  % git pull --rebase origin master
+  # Rerun the appropriate tests if needed.
+  % ninja check-$whatever
+  # Check that the list of commits about to be pushed is correct.
+  % git log origin/master...HEAD --oneline
+  # Push to Github.
+  % git push origin HEAD:master
+
 LLVM currently has a linear-history policy, which means that merge commits are
 not allowed. The `llvm-project` repo on github is configured to reject pushes
 that include merges, so the `git rebase` step above is required.
 
+Please ask for help if you're having trouble with your particular git workflow.
+
 Bisecting commits
 ^^^^^^^^^^^^^^^^^