Created
June 16, 2023 16:51
-
-
Save DanEdens/a2a7659bdf4ba1261e9c6688ba9c55e7 to your computer and use it in GitHub Desktop.
Git repo Toggle. Will either re-Clone or autocommit and delete. I made this to be able to remove clutter without losing easy access to it. Includes sh and cmd versions
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
@echo off | |
setlocal | |
set repo_url=https://github.com/DanEdens/resume.git | |
set repo_folder=resume | |
if not exist "%repo_folder%" ( | |
echo Cloning repository... | |
git clone "%repo_url%" "%repo_folder%" | |
cd "%repo_folder%" | |
) else ( | |
echo Repository folder already exists. Performing commit and push. | |
cd "%repo_folder%" | |
git add --all | |
git commit -m "Commit message" | |
git push origin master | |
cd .. | |
rd /s /q "%repo_folder%" | |
) | |
endlocal |
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
#!/bin/bash | |
repo_url="https://github.com/DanEdens/resume.git" | |
repo_folder="resume" | |
if [ ! -d "$repo_folder" ]; then | |
echo "Cloning repository..." | |
git clone "$repo_url" "$repo_folder" | |
cd "$repo_folder" | |
else | |
echo "Repository folder already exists. Performing commit and push." | |
cd "$repo_folder" | |
git add --all | |
git commit -m "Commit message" | |
git push origin master | |
cd .. | |
rm -rf "$repo_folder" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment