]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
doc/dev: add git branch management commands 49739/head
authorZac Dover <zac.dover@gmail.com>
Fri, 13 Jan 2023 20:48:57 +0000 (06:48 +1000)
committerZac Dover <zac.dover@gmail.com>
Fri, 13 Jan 2023 21:32:34 +0000 (07:32 +1000)
Add git branch deleting and search commands to the "Basic Workflow" page
of the Developer Guide.

Signed-off-by: Zac Dover <zac.dover@gmail.com>
(cherry picked from commit f1c0c3ec3d0d56d4615a77d5912018dc0542c959)

doc/dev/developer_guide/basic-workflow.rst

index 5917b56bef863b8e4df7556b132be4c015242c9b..7f42bea66b04dc9fe18887d88e54f46d1cf0a5bf 100644 (file)
@@ -513,3 +513,57 @@ the **ptl-tool** have the following form::
              client: add timer_lock support
      Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
 
+Miscellaneous
+-------------
+
+--set-upstream
+^^^^^^^^^^^^^^
+
+If you forget to include the ``--set-upstream origin x`` option in your ``git
+push`` command, you will see the following error message:
+
+::
+
+   fatal: The current branch {x} has no upstream branch.
+   To push the current branch and set the remote as upstream, use
+      git push --set-upstream origin {x}
+
+To set up git to automatically create the upstream branch that corresponds to
+the branch in your local working copy, run this command from within the
+``ceph/`` directory:
+
+.. prompt:: bash $
+
+   git config --global push.autoSetupRemote true
+
+Deleting a Branch Locally
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+To delete the branch named ``localBranchName`` from the local working copy, run
+a command of this form:
+
+.. prompt:: bash $
+
+   git branch -d localBranchName
+
+Deleting a Branch Remotely
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+To delete the branch named ``remoteBranchName`` from the remote upstream branch
+(which is also your fork of ``ceph/ceph``, as described in :ref:`forking`), run
+a command of this form:
+
+.. prompt:: bash $
+
+   git push origin --delete remoteBranchName
+
+Searching a File Longitudinally for a String
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+To search for the commit that introduced a given string (in this example, that
+string is ``foo``) into a given file (in this example, that file is
+``file.rst``), run a command of this form:
+
+.. prompt:: bash $
+
+   git log -S 'foo' file.rst