Introduction
Introduction Statistics Contact Development Disclaimer Help
Adding shell function for git mirror. - dotfiles - These are my dotfiles. There…
Log
Files
Refs
README
---
commit 8e19d3ccc47045462676ef5b3499f3b31a761e93
parent 1bbe6709f226fc75c75271dd1879f37c6912ca40
Author: Jay Scott <[email protected]>
Date: Wed, 17 Jul 2024 18:40:13 +0100
Adding shell function for git mirror.
Diffstat:
M ashrc | 11 +++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/ashrc b/ashrc
@@ -54,3 +54,14 @@ export LANG=en_US.UTF-8
export LC_CTYPE="en_US.UTF-8"
export LC_ALL=en_US.UTF-8
export PS1="\[\e[00;34m\]▶▶▶ \W \[\e[0m\]"
+
+mirror_repo() {
+ if [ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1; then
+ remote_url="[email protected]:$(basename $(pwd))"
+ git remote add mirror "$remote_url" 2>/dev/null || true
+ git push --mirror mirror
+ echo "Mirrored to $remote_url"
+ else
+ echo "Not a git repository"
+ fi
+}
You are viewing proxied material from jay.scot. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.