[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
This commit is contained in:
Zola Bridges 2020-05-17 10:11:26 -07:00
parent 348da7eec3
commit b2d733c350
1 changed files with 18 additions and 0 deletions

View 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
^^^^^^^^^^^^^^^^^