X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;ds=inline;f=pep-103.txt;h=5f7998a8e7c374f827fe973bb63b96bf7032f926;hb=5cf9f4d906a35f510fe4e2f5f05fda5b08b746b6;hp=bbcb3d46408a8d9f6054cff8e42f9ed52d8616b1;hpb=a93ea3ef2756a08be7327badb3f04500a9971a68;p=git-wiki.git
diff --git a/pep-103.txt b/pep-103.txt
index bbcb3d4..5f7998a 100644
--- a/pep-103.txt
+++ b/pep-103.txt
@@ -714,6 +714,25 @@ command. For example::
$ git check-attr -a -- \*.py
+Useful assets
+-------------
+
+`GitAlias `_ (`repository
+`_) is a big collection of
+aliases. A careful selection of aliases for frequently used commands
+could save you a lot of keystrokes!
+
+`GitIgnore `_ and
+https://github.com/github/gitignore are collections of ``.gitignore``
+files for all kinds of IDEs and programming languages. Python
+included!
+
+`pre-commit `_ (`repositories
+`_) is a framework for managing and
+maintaining multi-language pre-commit hooks. The framework is written
+in Python and has a lot of plugins for many programming languages.
+
+
Advanced topics
===============
@@ -753,6 +772,34 @@ See `WhatIsTheIndex
Wiki.
+Root
+====
+
+Git switches to the root (top-level directory of the project where
+``.git`` subdirectory exists) before running any command. Git
+remembers though the directory that was current before the switch.
+Some programs take into account the current directory. E.g., ``git
+status`` shows file paths of changed and unknown files relative to the
+current directory; ``git grep`` searches below the current directory;
+``git apply`` applies only those hunks from the patch that touch files
+below the current directory.
+
+But most commands run from the root and ignore the current directory.
+Imagine, for example, that you have two work trees, one for the branch
+``v1`` and the other for ``master``. If you want to merge ``v1`` from
+a subdirectory inside the second work tree you must write commands as
+if you're in the top-level dir. Let take two work trees,
+``project-v1`` and ``project``, for example::
+
+ $ cd project/subdirectory
+ $ git fetch ../project-v1 v1:v1
+ $ git merge v1
+
+Please note the path in ``git fetch ../project-v1 v1:v1`` is
+``../project-v1`` and not ``../../project-v1`` despite the fact that
+we run the commands from a subdirectory, not from the root.
+
+
ReReRe
======
@@ -775,7 +822,7 @@ working tree::
$ git config rerere.autoupdate true
You don't need to turn rerere on globally - you don't want rerere in
-bare repositories or single-branche repositories; you only need rerere
+bare repositories or single-branch repositories; you only need rerere
in repos where you often perform merges and resolve merge conflicts.
See `Rerere `_ in The
@@ -846,12 +893,12 @@ but you can use your editor::
BTW, if git is instructed to use ``less`` as the pager (i.e., if pager
is not configured in git at all it uses ``less`` by default, or if it
gets ``less`` from GIT_PAGER or PAGER environment variables, or if it
-was configured with ``git config --global core.pager less``, or
+was configured with ``git config [--global] core.pager less``, or
``less`` is used in the command ``git grep -Oless``) ``git grep``
passes ``+/$pattern`` option to ``less`` which is quite convenient.
Unfortunately, ``git grep`` doesn't pass the pattern if the pager is
not exactly ``less``, even if it's ``less`` with parameters (something
-like ``git config --global core.pager less -FRSXgimq``); fortunately,
+like ``git config [--global] core.pager less -FRSXgimq``); fortunately,
``git grep -Oless`` always passes the pattern.