I use temporary branches and permanent tags in my Git repos. This post demonstrates how to create a “y-shaped” local repository with no remotes and then push all tags from that local repository to a new bare remote.
mkdir local
cd local
git init
echo "dummy text" > abc.txt
git add abc.txt
git commit -m "Add first file"
echo "more text" >> abc.txt
git commit -a -m "Mod first file"
git tag tagA
git log
(note the SHA1 for the first commit)git checkout <SHA1 of first commit> -B master
echo "different second line" >> abc.txt
git commit -a -m "Take things in a different direction"
git tag tagB
git checkout <SHA1 of first commit> -B master
Here’s what the “y-shaped” local repo looks like in gitk --all
: