Skip to content

Commit

Permalink
Add git-checkout-tag script.
Browse files Browse the repository at this point in the history
For tag 'FOO-1.0':

$ git checkout-tag FOO-1.0
Switched to a new branch 'FOO-1.0-branch'

Just avoids confusing branch names.
  • Loading branch information
alikins committed Jan 29, 2016
1 parent 2bc43af commit 25d5a75
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
15 changes: 15 additions & 0 deletions bin/git-checkout-tag
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash


# checkout a tag "FOO-1-0" into a branch called "FOO-1-0-branch"

checkout-tag()
{
tagname="${1:-}"
if [[ "${tagname}" ]] ; then
branchname="${tagname}"-branch
git checkout -b "${branchname}" "${tagname}"
fi
}

checkout-tag "$@"
7 changes: 5 additions & 2 deletions gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
command = true


[diff "podiff"]
#textconv = /usr/bin/podiff -t
#[diff "podiff"]
# textconv = /usr/bin/podiff -t
#command = /usr/bin/podiff -D-u -L

#
Expand Down Expand Up @@ -346,6 +346,9 @@
# usage: `git whatadded --foo.c`
whatadded = log --follow --diff-filter=A --find-renames=40%

# checkout a tag into a branch
checkout-tag = "!f() { tagname=${1}; branchname='${tagname}-branch'; git checkout -b '${branchname}' '${tagname}'; } ; f"

# show a specifc version of a file
# git show rev:filename

Expand Down

0 comments on commit 25d5a75

Please sign in to comment.