We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6846b78 commit 32b3545Copy full SHA for 32b3545
.gitignore
@@ -0,0 +1 @@
1
+.idea/
git/branch_update.sh
@@ -2,18 +2,29 @@
2
clear
3
4
CURRENT=$(git name-rev --name-only HEAD)
5
+CHANGES=$(git status -su | wc -l)
6
7
+# sync with another branch
8
BRANCH="master"
9
if [ "$1" = "-b" ] && [ -n "$2" ];
10
then
11
BRANCH="$2"
12
fi
13
-git stash
14
+# is there something for add to stage?
15
+if [ "$CHANGES" -ne "0" ];
16
+then
17
+ git stash
18
+fi
19
+
20
git checkout "$BRANCH"
21
git pull
22
git checkout "$CURRENT"
23
git merge "$BRANCH" -m "Update $CURRENT from $BRANCH"
-git stash pop
24
25
26
27
+ git stash pop
28
29
30
git status
0 commit comments