Skip to content

Commit

Permalink
git notes- handle forced DEL of existing branch
Browse files Browse the repository at this point in the history
git notes- Add files, dunno why i removed this
  • Loading branch information
plodah committed Nov 27, 2024
1 parent 7c95a56 commit 5b3b845
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions users/plodah/firmware-diffs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ git push origin master --force
```sh
# Delete a branch locally and remotely
git checkout master #checkout anything other than the branch to be deleted.
git branch -D naffbranch
git push -d origin naffbranch
git branch -D naffbranch # Local
git push -d origin naffbranch # Remote
```


Expand All @@ -57,8 +57,15 @@ update-branch() {

if [ -z "$testlocsrc" ]; then echo "LOCAL BRANCH \"$src\" DOES NOT EXIST"; fail=true; fi
if [ -z "$testremsrc" ]; then echo "REMOTE BRANCH \"$src\" DOES NOT EXIST"; fail=true; fi
if [ -n "$testlocdst" ]; then echo "DESTINATION ALREADY EXISTS LOCALLY: \"$dst\""; fail=true; fi
if [ -n "$testremdst" ]; then echo "DESTINATION ALREADY EXISTS REMOTE: \"origin/$dst\""; fail=true; fi

if [ -n "$testlocdst" ]; then echo "DESTINATION ALREADY EXISTS LOCALLY: \"$dst\""
if [ -z $fail ] && [ "DEL" == $del ]; then git checkout $src; git branch -D $dst
else fail=true; fi
fi
if [ -n "$testremdst" ]; then echo "DESTINATION ALREADY EXISTS REMOTE: \"origin/$dst\""
if [ -z $fail ] && [ "DEL" == $del ]; then git push -d origin $dst
else fail=true; fi
fi

if [ -z $fail ]; then
git checkout $src
Expand All @@ -72,7 +79,8 @@ update-branch() {
msg="apply diff '$diffname'"
echo "--- $msg ---"
git apply $d
git commit -am "$msg"
git add .
git commit --all --message "$msg"
done

# git diff $src --stat
Expand Down

0 comments on commit 5b3b845

Please sign in to comment.