Skip to content

Commit

Permalink
add scripts for android git
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxWolf-01 committed Apr 11, 2024
1 parent dec6028 commit 1a4adb9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bin/obsidian_fix_corrupt_object_android
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

cd ~/storage/shared/obsidian/knowledge-base || exit
# backup
rsync -r --exclude '.git' . ../knowledge-base-backup

# remove empty objects, fetch missing objects, full check of object store: https://stackoverflow.com/a/31110176/17777085
find .git/objects/ -type f -empty | xargs -r rm
git fetch -p
git fsck --full
16 changes: 16 additions & 0 deletions bin/push_branch_with_conflicts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
# useful if you encounter merge conflicts on android/... and want to resolve them with ide
echo "This script will push local changes to an extra branch and reset master to remote"
echo "Make sure you are in the correct repo, otherwise press Ctrl+C"
echo "Current directory: $(pwd)"
echo "Press enter to continue"
read -r
# If local repo needs merging and you want to resolve it with ide -> this script pushes local changes to an extra branch and resets master to remote
git remote prune # remove stale branches
git switch master
stamp="$(date + %H%M)"
git switch -c tmp/merge-conflicts-"$stamp"
git push -u origin tmp/merge-conflicts-"$stamp"
git switch master
git fetch --all
git reset --hard origin/master

0 comments on commit 1a4adb9

Please sign in to comment.