Skip to content

git-for-windows docs #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,28 @@ by adding the following to your .bashrc.
source ${REPO_PATH}/gi-completion.sh
```

### [Git for Windows](https://gitforwindows.org/)
If you are running Git for Windows and do not have `make` available,
first note that the default installation location of `/usr/local`
cannot be used as it returns "permission denied". One alternative
includes `PREFIX=$HOME`, assuming that Windows is configured with the
appropriate environment variable; regardless, you must determine this
destination and determine that you have permissions to create that
path.

If `install_gfw.sh` does not exist, then you can first create it with

```
sh sync-docs.sh
```

Using the determined installation destination for `PREFIX`, install
using

```
PREFIX=... sh install_gfw.sh
```

### Backward compatibility with the gi command
For backward compatibility you can also use the original _gi_ command,
by copying `gi.sh` to someplace in your path.
Expand Down
12 changes: 12 additions & 0 deletions sync-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@
SCRIPT_NAME=git-issue.sh
MAN_PAGE=git-issue.1

sed -n \
-E '1,/^SYSCONFDIR/p; /^install:/,/^\S/ { /^\S/d; p; }' Makefile | \
sed -E '{
# remove Makefile leading no-echo @
s/^\s*@?// ;
# convert Makefile ?= conditional assignment to bash :-
s/^([^? ]+)\s*\?=\s*(.*)$/\1=${\1:-\2}/g ;
# convert $(VAR) to ${VAR}
s/\$\(([^)]+)\)/${\1}/g
}' > install_gfw.sh
chmod +x install_gfw.sh

# Update usage information in the script based on README.md
{
sed -n '1,/^The following commands are available:/p' $SCRIPT_NAME
Expand Down