File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -241,18 +241,21 @@ function updategit() {
241241 git checkout -- . 2> /dev/null \
242242 || sudo git checkout -- .
243243
244+ # Get origin branch name
245+ origin_branch=$( git branch -l master main | sed ' s/^* //' )
246+
244247 # Update from git
245248 echo -e " \n[i] Git pull'ing"
246- git pull -v upstream master 2> /dev/null \
247- || sudo git pull -v upstream master
249+ git pull -v upstream $origin_branch 2> /dev/null \
250+ || sudo git pull -v upstream $origin_branch
248251
249252 # If conflicts, clean and try again
250253 if [[ " $? " -ne 0 ]]; then
251254 echo -e " \n[-] Git conflict"
252255 git clean -d -fx " " \
253256 || sudo git clean -d -fx " "
254- git pull -v upstream master \
255- || sudo git pull -v upstream master
257+ git pull -v upstream $origin_branch \
258+ || sudo git pull -v upstream $origin_branch
256259 fi
257260
258261 echo -e " \n[*] Git update finished"
You can’t perform that action at this time.
0 commit comments