Created
May 23, 2024 16:52
-
-
Save wilsonsilva/e5845bedb01ef3f88610c5b9a9f78cfe to your computer and use it in GitHub Desktop.
Change directory (cd) into a local github repository
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
ghcd() { | |
if [ -z "$1" ]; then | |
echo "Usage: ghcd <username/repo>" | |
else | |
wd github | |
folder_name=$(echo "$1" | cut -d "/" -f1) | |
repo_name=$(echo "$1" | cut -d "/" -f2) | |
cd "$folder_name/$repo_name" | |
fi | |
} | |
# requires wd and a wd alias called github. Alternatively, replace wd github above with the absolute path of your Github repos |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment