[PATCH] D63023: [docs] Add 'git llvm revert' to getting started guide

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 7 12:59:41 PDT 2019


rupprecht created this revision.
rupprecht added reviewers: jyknight, mehdi_amini.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This documents `git llvm revert rNNNNNN` in the getting started guide for broader visibility.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D63023

Files:
  llvm/docs/GettingStarted.rst


Index: llvm/docs/GettingStarted.rst
===================================================================
--- llvm/docs/GettingStarted.rst
+++ llvm/docs/GettingStarted.rst
@@ -525,6 +525,26 @@
 tell you what it would have done. That can be useful if you're unsure whether
 the right thing will happen.
 
+Reverting a change when using Git
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+If you're using Git and need to revert a patch, Git needs to be supplied a
+commit hash, not an svn revision. To make things easier, you can use
+``git llvm revert`` to revert with either an SVN revision or a Git hash instead.
+
+Additionally, you can first run with ``git llvm revert -n`` to print which Git
+commands will run, without doing anything.
+
+Running ``git llvm revert`` will only revert things in your local repository. To
+push the revert upstream, you still need to run ``git llvm push`` as described
+earlier.
+
+.. code-block:: console
+
+  % git llvm revert rNNNNNN       # Revert by SVN id
+  % git llvm revert abcdef123456  # Revert by Git commit hash
+  % git llvm revert -n rNNNNNN    # Print the commands without doing anything
+
 Checkout via SVN (deprecated)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63023.203604.patch
Type: text/x-patch
Size: 1193 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190607/c542eea6/attachment.bin>


More information about the llvm-commits mailing list