Page MenuHomePhabricator

git-attach-head

Authored By
mmodell
Jun 29 2016, 4:28 PM
Size
318 B
Referenced Files
None
Subscribers
None

git-attach-head

#!/bin/bash
branch=$(git branch -r --no-color --contains HEAD | head -n1 | awk '{gsub(".*/","");print $1}')
commit=`git rev-parse HEAD`
branch_commit=$(git rev-parse "$branch")
echo "branch: $branch HEAD=$commit branch_commit=$branch_commit"
if [ "$commit" == "$branch_commit" ]; then
echo git checkout $branch
fi

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3828700
Default Alt Text
git-attach-head (318 B)

Event Timeline