Git Basics – Part 2

Listing tags

git tag

Search for tags

git tag -l 'v1.*'

Create new annotated tag

git tag -a v1.0 -m 'version 1.0'

Create new lightweight tag – stores commit checksum in a file

git tag v1.0-lw

Transfer tag to the remote server

git push origin [tagname]

Transfer all tags to the remote server

git push origin --tags

Listing branches

git branch

See the last commit on each branch

git branch -v

Create a branch and switch to it

git checkout -b [branchname]

Switch back to your master branch

git checkout master

Merge branch back into your master branch

git checkout master
git merge [branchname]

Delete a branch

git branch -d [branchname]

Switch back to your work-in-progress branch

git checkout [branchname]

Git Basics – Part 1

Categories: Version Control Tags: , ,
%d bloggers like this: