Skip to content

Commit 8dbfeb0

Browse files
committed
Add gcb scripts
1 parent 760d992 commit 8dbfeb0

File tree

6 files changed

+125
-0
lines changed

6 files changed

+125
-0
lines changed

gcb-clear

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
set -e
4+
set -o pipefail
5+
6+
NAME=`git config branch.master.merge`
7+
8+
git push origin ":$NAME"

gcb-clone

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/sh
2+
3+
set -e
4+
set -o pipefail
5+
6+
USER="$1"
7+
REPO="$2"
8+
INIT="$3"
9+
NAME="refs/remotes/origin/HEAD"
10+
11+
help ()
12+
{
13+
echo "Usage: $0 <github_user> <github_repo> [covert_path]"
14+
}
15+
16+
if [ -z "$USER" ];
17+
then
18+
help
19+
echo "user not set"
20+
exit 1
21+
fi
22+
23+
if [ -z "$REPO" ];
24+
then
25+
help
26+
echo "repo not set"
27+
exit 1
28+
fi
29+
30+
if [ -z "$INIT" ];
31+
then
32+
INIT="."
33+
fi
34+
35+
git init "$INIT"
36+
37+
cd "$INIT"
38+
39+
git remote add origin "https://github.com/$USER/$REPO.git"
40+
41+
git config branch.master.remote origin
42+
git config branch.master.merge "$NAME"
43+
git config push.default simple
44+
45+
git pull origin "$NAME:master" --depth=1

gcb-init

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/sh
2+
3+
set -e
4+
set -o pipefail
5+
6+
USER="$1"
7+
REPO="$2"
8+
INIT="$3"
9+
NAME="refs/remotes/origin/HEAD"
10+
11+
help ()
12+
{
13+
echo "Usage: $0 <github_user> <github_repo> [covert_path]"
14+
}
15+
16+
if [ -z "$USER" ];
17+
then
18+
help
19+
echo "user not set"
20+
exit 1
21+
fi
22+
23+
if [ -z "$REPO" ];
24+
then
25+
help
26+
echo "repo not set"
27+
exit 1
28+
fi
29+
30+
if [ -z "$INIT" ];
31+
then
32+
INIT="."
33+
fi
34+
35+
git init "$INIT"
36+
37+
cd "$INIT"
38+
39+
git remote add origin "https://github.com/$USER/$REPO.git"
40+
41+
git config branch.master.remote origin
42+
git config branch.master.merge "$NAME"
43+
git config push.default simple
44+
45+
git checkout --orphan "master"
46+
git commit --allow-empty --message "initial covert commit"

gcb-pull

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
set -e
4+
set -o pipefail
5+
6+
NAME=`git config branch.master.merge`
7+
8+
git pull origin "$NAME:HEAD"

gcb-push

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
set -e
4+
set -o pipefail
5+
6+
NAME=`git config branch.master.merge`
7+
8+
git push origin "HEAD:$NAME"

gcb-urls

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
set -e
4+
set -o pipefail
5+
6+
BASE=`git config remote.origin.url | sed 's/\.git$//'`
7+
HEAD=`git rev-parse HEAD`
8+
9+
echo "tree: $BASE/tree/$HEAD"
10+
echo "pack: $BASE/archive/$HEAD.zip"

0 commit comments

Comments
 (0)