restore: pull invokes an editor; so, rather do not do this (for non-interactivity...
[gitgitconfig.git] / gitgitconfig-save
blob621ea09e7d336974cb993602e8b4e49436123080
1 #!/bin/bash -ex
3 # We don't want (for now) to work with .git in nonstandard locations.
4 #readonly REPOCONFIGDIR="$(git rev-parse --git-dir)"
5 readonly REPODIR="$(git rev-parse --show-toplevel)"
7 cd "$REPODIR"/.git
9 if [[ -d .git ]]; then
10 # Already initialized.
11 # Please, add and commit interesting files beforehand manually.
13 else
14 # Not initialized.
15 pushd ..
16 gitgitconfig-init
17 popd
18 git add .
19 git commit -m 'Saving your .git/config etc. automatically.'
22 # We'd like to push our local <branches> to GITCONFIG/<branches>
23 # in your main working repo.
24 git push origin refs/heads/*:refs/heads/GITCONFIG/*
25 # (In our gitgitconfig-init, we have set up such behavior for master only).
27 # Then take care to propagate GITCONFIG/master to all your remotes
28 # when pushing from your main repo.