diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2020-01-28 23:34:06 -0500 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2020-01-28 23:34:06 -0500 |
| commit | 34708dfa902afabf4833c25233132e56514915de (patch) | |
| tree | 0f4fd5c2c8d782885c5b821114b060e89fce1dcd /wiki/git/integrate.md | |
| parent | 9bf334de6a2a17371eae9bcdf342c416332350aa (diff) | |
| parent | 6a7b97b436a5a20c172e6b04bf0caa37d544fde4 (diff) | |
Switch to mkdocs.
Diffstat (limited to 'wiki/git/integrate.md')
| -rw-r--r-- | wiki/git/integrate.md | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/wiki/git/integrate.md b/wiki/git/integrate.md deleted file mode 100644 index 801ddd5..0000000 --- a/wiki/git/integrate.md +++ /dev/null @@ -1,41 +0,0 @@ -# Integrating with Git: A Field Guide - -Pretty much everything you might want to do to a Git repository when writing -tooling or integrations should be done by shelling out to one `git` command or -another. - -## Finding Git's trees - -Git commands can be invoked from locations other than the root of the work -tree or git directory. You can find either of those by invoking `git -rev-parse`. - -To find the absolute path to the root of the work tree: - - git rev-parse --show-toplevel - -This will output the absolute path to the root of the work tree on standard -output, followed by a newline. Since the work tree's absolute path can contain -whitespace (including newlines), you should assume every byte of output save -the final newline is part of the path, and if you're using this in a shell -script, quote defensively. - -To find the relative path from the current working directory: - - git rev-parse --show-cdup - -This will output the relative path to the root of the work tree on standard -output, followed by a newline. - -For bare repositories, both commands will output nothing and exit with a zero -status. (Surprise!) - -To find *a* path to the root of the git directory: - - git rev-parse --git-dir - -This will output either the relative or the absolute path to the git -directory, followed by a newline. - -All three of these commands will exit with non-zero status when run outside of -a work tree or git directory. Check for it. |
