-
Notifications
You must be signed in to change notification settings - Fork 2
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
John Major
committed
Mar 9, 2025
1 parent
aa0e750
commit ce515b6
Showing
5 changed files
with
180 additions
and
46 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
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
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,19 @@ | ||
#!/bin/bash | ||
|
||
# Check if we're in a Git repository | ||
if ! git rev-parse --is-inside-work-tree &>/dev/null; then | ||
echo "Not inside a Git repository." | ||
exit 1 | ||
fi | ||
|
||
# Get the repository name (extract from remote URL) | ||
repo_name=$(basename -s .git "$(git config --get remote.origin.url 2>/dev/null)") | ||
|
||
# Get the current branch name (if on a branch) | ||
branch_name=$(git symbolic-ref --short HEAD 2>/dev/null || echo "N/A") | ||
|
||
# Get the latest commit hash | ||
commit_hash=$(git rev-parse HEAD 2>/dev/null) | ||
|
||
# Output results | ||
echo $repo_name-$branch_name-$commit_hash |
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
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