X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=pep-git.txt;h=d45ef5d9379d48d4510fa168d9a3514085917a43;hb=dbb0b4036a988dcd24d9e1e28c8ded00934446d0;hp=6a9f20b2371c9cb813d6268f946c2d9011012fda;hpb=a6d17ba08116f8da6ab854e3913c2ab10c9a7aea;p=git-wiki.git diff --git a/pep-git.txt b/pep-git.txt index 6a9f20b..d45ef5d 100644 --- a/pep-git.txt +++ b/pep-git.txt @@ -3,7 +3,7 @@ Title: Collecting information about git Version: $Revision$ Last-Modified: $Date$ Author: Oleg Broytman -Status: Active +Status: Draft Type: Informational Content-Type: text/x-rst Created: 01-Jun-2015 @@ -85,6 +85,13 @@ MacOS X: use git installed with `XCode `_ or install git with `Homebrew `_: ``brew install git``. +`git-cola `_ is a sleek and +powerful Git GUI written in Python and GPL licensed. Linux, Windows, +MacOS X. + +`TortoiseGit `_ is a Windows Shell Interface +to Git based on TortoiseSVN; open source. + Initial configuration --------------------- @@ -379,6 +386,60 @@ https://kernel.org/pub/software/scm/git/docs/howto/revert-a-faulty-merge.html Merge or rebase? ================ +Internet is full of heated discussions on the topic: "merge or +rebase?" Most of them are meaningless. When a DVCS is being used in a +big team with a big and complex project with many branches there is +simply no way to avoid merges. So the question's diminished to +"whether to use rebase, and if yes - when to use rebase?" Considering +that it is very much recommended not to rebase published commits the +question's diminished even further: "whether to use rebase on +non-pushed commits?" + +That small question is for the team to decide. The author of the PEP +recommends to use rebase when pulling, i.e. always do ``git pull +--rebase`` or even configure automatic setup of rebase for every new +branch:: + + $ git config branch.autosetuprebase true + +and configure rebase for existing branches:: + + $ git config branch.NAME.rebase true + +For example:: + + $ git config branch.v2.rebase true + +After that ``git pull origin v2`` becomes equivalent to ``git pull +--rebase origin v2``. + +In case when merge is preferred it is recommended to create new +commits in a separate feature or topic branch while using rebase to +update the mainline branch. When the topic branch is ready merge it +into mainline. To avoid a tedious task of resolving conflicts you can +merge the topic branch to the mainline from time to time and switch +back to the topic branch to continue working on it. The entire +workflow would be something like:: + + $ git checkout -b issue-42 # create and switch to a new branch + ...edit/test/commit... + $ git checkout v2 + $ git pull --rebase origin v2 # update v2 from the upstream + $ git merge issue-42 + $ git branch -d issue-42 # delete the topic branch + $ git push origin v2 + +When the topic branch is deleted only the label is removed, commits +are stayed in the database, they are now merged into v2:: + + o--o--o--o--o--M--< v2 - it is the mainline branch + \ / + --*--*--* - it is the topic branch, now unnamed + +The topic branch is deleted to avoid cluttering branch namespace with +small topic branches. Information on what issue was fixed or what +feature was implemented should be in the commit messages. + Null-merges ===========