Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P3314
git-attach-head
Active
Public
Actions
Authored by
•
mmodell
on Jun 29 2016, 4:28 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F4213117: git-attach-head
Jun 29 2016, 4:28 PM
2016-06-29 16:28:42 (UTC+0)
Subscribers
thcipriani
#!/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
Event Timeline
•
mmodell
created this paste.
Jun 29 2016, 4:28 PM
2016-06-29 16:28:42 (UTC+0)
ChristianKl
mentioned this in
T149616: Prevent duplicate properties and items from getting created
.
Oct 31 2016, 7:15 PM
2016-10-31 19:15:31 (UTC+0)
Log In to Comment