From b2d733c350782cbdcc5684bb93e9c27cadc3a649 Mon Sep 17 00:00:00 2001 From: Zola Bridges Date: Sun, 17 May 2020 10:11:26 -0700 Subject: [PATCH] [llvm][docs] Add step by step git to GettingStarted 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. Context 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 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/llvm/docs/GettingStarted.rst b/llvm/docs/GettingStarted.rst index fbcb7aa86ca..46e337d2cec 100644 --- a/llvm/docs/GettingStarted.rst +++ b/llvm/docs/GettingStarted.rst @@ -496,10 +496,28 @@ required access rights. See `committing a change `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 ^^^^^^^^^^^^^^^^^ -- 2.11.0