-
Notifications
You must be signed in to change notification settings - Fork 8
/
∆merge.sh
executable file
·53 lines (49 loc) · 1.54 KB
/
∆merge.sh
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env bash
BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [[ "$BRANCH" != "rebase_branch" ]]; then
echo 'Aborting script because you are on rebase_branch branch.';
exit 1;
fi
# TODO, use node --check to ensure good merges, etc
#(./test/testsrc/shell/node-c.sh && echo "compiled successfully")
# ./node_modules/.bin/ncf --rt $(dirname "$0") --np=**/test/** --np=**/node_modules/** --v 3 --c=8
NEW_BRANCH=merge_this_branch_with_dev_$(node -e 'console.log(Date.now())')
git add . &&
git add -A &&
git commit --allow-empty -am "final commit before rebase 1" &&
git push &&
git fetch origin &&
git checkout dev &&
git add . &&
git add -A &&
git commit --allow-empty -am "final commit before rebase 2" &&
git pull &&
git add . &&
git add -A &&
git commit --allow-empty -am "final commit before rebase 3" &&
git checkout ${BRANCH} &&
git branch -D copy_branch &&
git checkout -b copy_branch &&
git checkout ${BRANCH} &&
git add -all &&
#git clean -f &&
#git clean -f -d &&
#git reset --hard HEAD && # this gets rid of untracked files somehow?
echo "now running reset --soft"
git reset --soft dev &&
echo "successfully called reset soft"
git add . &&
git add -A &&
git commit --allow-empty -am "reset:sft" &&
git checkout -b ${NEW_BRANCH} &&
git add . &&
git add -A &&
git commit --allow-empty -am "reset:sft" &&
git push -u origin ${NEW_BRANCH} &&
#git clean -f &&
#git clean -f -d &&
#git reset --hard HEAD && # this gets rid of untracked files somehow?
git checkout ${BRANCH} -f &&
git branch -D ${NEW_BRANCH} &&
#git merge dev &&
echo "successfully pushed"