Skip to content

Commit

Permalink
Add work cloning and SSH aliasing
Browse files Browse the repository at this point in the history
  • Loading branch information
mtscout6 committed Apr 30, 2021
1 parent f3da07a commit a3e28bd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
22 changes: 22 additions & 0 deletions _bin/git-work-clone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

# Reference https://gist.github.com/oanhnn/80a89405ab9023894df7

repo=$1;
repo=${repo/github.com/github-work}

git clone $repo $2;

if [[ $2 -eq 0 ]]
then
pattern='/(.*).git'
[[ $repo =~ $pattern ]]
directory=${BASH_REMATCH[1]}
else
directory=$2
fi

cd $directory

git config user.email "[email protected]"
git config github.user "matt-smith-sp"
2 changes: 1 addition & 1 deletion _gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
fa = fetch -p --all
rc = rebase --continue

work = config user.email "[email protected]"
clonew = "!f() { ~/.bin/git-work-clone.sh $@; } ; f"
[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
Expand Down

0 comments on commit a3e28bd

Please sign in to comment.