-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit2-swap-git2
More file actions
executable file
·32 lines (23 loc) · 846 Bytes
/
git2-swap-git2
File metadata and controls
executable file
·32 lines (23 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# require library functions
SCRIPTPATH="$(readlink -f 2>/dev/null || perl -MCwd -e 'print Cwd::abs_path shift' $0)"
source "$(dirname "${SCRIPTPATH}")/lib.sh"
git2_search_base_dir
echo "swapped git1 and git2"
# git2 name:
append=`echo "${GITTWO_DIRNAME}" | sed -e 's/\.//g'`
# move to swap:
move_files ".${append}" .gitswap
move_files ".gitignore_${append}" ".gitignore_gitswap"
move_files ".gitattributes_${append}" ".gitattributes_gitswap"
# move git to git2:
move_files ".git" ".${append}"
move_files ".gitignore" ".gitignore_${append}"
move_files ".gitattributes" ".gitattributes_${append}"
# move swap to git:
move_files .gitswap .git
move_files ".gitignore_gitswap" ".gitignore"
move_files ".gitattributes_gitswap" ".gitattributes"
# remove info/exclude of git1
echo >${GITTWO_BASE}.git/info/exclude
git2 setup-exclude