repo.or.cz
/
gitgitconfig.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
restore: Implemented with rebase and reset. (Do not forget to reset manually in case...
[gitgitconfig.git]
/
tests
/
remoteadd-save-clone-restore.sh
blob
18fc34ca9615f2fa1209072e3bf40536eefd48d8
1
#!/bin/bash -ex
2
3
mkdir A
4
cd
A
5
6
git init
7
echo
a
>
a
8
git add a
9
git commit
-m
'A.'
10
git remote add there git
://
example.com
/
a.git
11
gitgitconfig-save
12
13
cd
..
14
15
git clone
-o
first A B
16
cd
B
17
18
gitgitconfig-restore first
19
20
if
[[
"$(git remote)"
==
"$(echo there)"
]];
then
21
exit
0
22
else
23
exit
1
24
fi