Mastering on Github

If you use Git each and every single day, this post might be helpful for you. I write this post for my personal preference as well.

Push commit to another Branch

If you are on a development team where there is more than 1 developer, you might need your personal branch to update your work. In this case, you need to know how to push the commit to another branch.

You need to specify the source ref and the target ref:

git push origin branch1:branch2


git push <remote> <branch with new changes>:<branch you are pushing to>


Creating Tags and Push

Lightweight Tags:

The other way to tag commits is a lightweight tag. we can do it in the following way:

$ git tag v2.1.0
$ git tag

Push Tag

To push particular tag you can use below command:

git push origin v1.0.3

or if you want to push all tags then use below command:

git push --tags

List all tags: To list all tags use the following command

git tag