Pushing Tags to a Remote Repository in Git

Tags in Git are a way to bookmark specific commits. This is often done to indicate different versions or releases of a project. When pushing to a remote repository tags are not included by default. To push a tag to the remote repository use: git push origin <tag name> To push all local tags to

read more

How to Remove Tags from a Git Repository

If you use tags with your Git repositories you know that sometimes it makes sense to remove/delete these tags. Below are samples of removing both local and remote tags from your Git repo. Delete Tag from Local Repository git tag -d <tag name> Delete Tag from Remote Repository (e.g. GitHub) git push origin :refs/tags/<tag name>

How to List Tags in Git

Tags in Git are a way to bookmark specific commits. This is often done to indicate different versions or releases of a project. To list the tags you have previously created in the current repository use: git tag. For repositories with many tags it may be useful to find tags by name. This is possible

read more

How to Create tags in Git

“Lightweight” tags in Git are simply pointers to specific commits. You can create a lightweight tag on the command line using: git tag <tag name>. This will create a local tag on the current branch. Listing Tags in Git To list the tags you have previously created use: git tag. For repositories with many tags

read more

How to Merge multiple commits in Git

The ability to merge multiple commits in Git is a huge plus. Merging commits requires “rebasing” which will essentially rewrite the project history appending commits onto the last commit (by default) in a different branch, or even to an earlier commit in the same branch. Rebasing can have some damaging effects, so be careful when

read more

How to Delete Local and Remote Branches in Git

Working with branches is a core part of using Git. Often you will want to clean up and remove local and/or remote branches. Below are examples of how to delete local and remote branches in Git. Delete a Local Branch 1) git branch -d <branch-name> 2) git branch –delete <branch-name> The results of these two

read more

How to Combine multiple Commits in Git

The ability to combine multiple commits in Git is a huge plus. Combining commits requires “rebasing” which will essentially rewrite the project history appending commits onto the last commit (by default) in a different branch, or even to an earlier commit in the same branch. Rebasing can have some damaging effects, so be careful when

read more

How to Change Branch Name in Git (Local and Remote)

Changing a branch’s name in Git is a common task and fortunately very easy to do. Changing the name of a local branch: git -m newBranchName If you are not on the branch being renamed, you must specify this branch in the command: git -m oldBranchName newBranchName There is no direct way to rename a

read more

Git – How to Push Local Branch to Remote Repo (like GitHub)

Branching is a common task when working with Git. However new branches on your local machine aren’t automatically added to your remote repository. You will need to explicitly push your local branch to your remote repository. You can do this on the command line using:

Remote repositories often have the alias “origin”. So if

read more