-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dec6028
commit 1a4adb9
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |