forked from breck7/ScrollHub
-
Notifications
You must be signed in to change notification settings - Fork 0
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
e07e055
commit 4bd80d1
Showing
1 changed file
with
25 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,25 @@ | ||
#!/bin/bash | ||
|
||
# run this command to add git acp command for updating remote server | ||
##git config --global alias.acp '!./git_acp.sh' | ||
|
||
# Remote server details | ||
REMOTE_USER="[email protected]" | ||
REMOTE_REPO_PATH="/root/" | ||
|
||
# Execute remote commands | ||
ssh $REMOTE_USER "cd $REMOTE_REPO_PATH && git status && if [ -n \"\$(git status --porcelain)\" ]; then git add . && git commit -m 'Remote commit'; fi && git pull && sleep 2" | ||
|
||
# Delay to ensure remote commands complete | ||
sleep 2 | ||
|
||
# Pull remote changes before adding and committing local changes | ||
git pull | ||
|
||
# Add and commit local changes | ||
git add . | ||
git commit -m "local update" | ||
sleep 2 | ||
|
||
# Push local changes to remote | ||
git push |