X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=pep-git.txt;h=0d33a63fd8fd6f9331cd182a43677b2b6e8d6d08;hb=bba455cde5e41e6a8df8dc7ae5db6db089a93adf;hp=d995d2456fe367ceaa1d0fa0a8081274497d2e2c;hpb=2081cc6efd1cc32ab084713a7e2d30d435f93131;p=git-wiki.git diff --git a/pep-git.txt b/pep-git.txt index d995d24..0d33a63 100644 --- a/pep-git.txt +++ b/pep-git.txt @@ -99,7 +99,13 @@ Examples of git commands in this PEP use the following approach. It is supposed that you, the user, works with a local repository named ``python`` that has an upstream remote repo named ``origin``. Your local repo has two branches ``v1`` and ``v2``. Usually the currently -checked out branch is ``v2``. +checked out branch is ``v2``. That is, it's assumed you did something +like:: + + $ git clone -b v1 http://git.python.org/python.git + $ cd python + $ git fetch origin v2:v2 + $ git checkout -b v2 Commit editing and caveats @@ -111,8 +117,8 @@ documentation but it's also repeated here as it's very important. It is possible to recover from forced push but it's PITA for the entire team. Please avoid it. -To see what commits have not been published yet see the head of the -remote branch:: +To see what commits have not been published yet compare the head of the +branch with its upstream remote branch:: $ git log origin/v2.. @@ -126,14 +132,20 @@ To see the status of all branches:: $ git branch -avv +To compare the status of local branches with remote repo:: + + $ git remote show origin + Read `how to recover from upstream rebase `_. It is in ``git help rebase``. On the other hand don't be too afraid about commit editing. You can -safely edit commits that hasn't been pushed yet. You can even push -commits to your own (backup) repo, edit them later and force-push -edited commits to replace what has already been pushed. +safely edit, remove, reorder, combine and split commits that hasn't +been pushed yet. You can even push commits to your own (backup) repo, +edit them later and force-push edited commits to replace what has +already been pushed. Not a problem until commits are in a public +repository. References