Git doesn’t allow to work on remote branches directly so you can’t literally checkout a remote branch. If you want to checkout a remote branch, you need to create your own local “copy” of that branch and then check it out. This note shows how to do this.
To checkout a remote branch in Git, first of all it is required to figure out what branches exist on a remote Git repository. By default, the git branch command lists the local branches only. In this short note i’ll show how to list only remote branches in Git and also how to list all […]
“You are in ‘detached HEAD’ state” is not an error message and is nothing to be worried about. This state means you are no longer on a branch, and it happens when an arbitrary commit is checked out instead of a branch. If this state was unintentional and you want to “fix” the ‘detached HEAD’, […]
Tags in Git are used to label specific commits (to mark releases, for example). In this note i will show how to create a Git tag and push it remote repository using the git tag and git push commands. I will also show how to find out the most recent tag name and how many […]
Tags in Git are used to label specific commits (to mark releases, for example). Once created locally, Git tags can be pushed to a remote repository. In this note i will show how to delete local Git tags using a git tag –delete command and how to remove Git tags from a remote repository.
Tags in Git are used to label specific commits (to mark releases, for example). Each tag points directly to a specific commit in the Git history. In this note i will show how to checkout a tag in Git and how to create a new branch from it.
Tags in a Git repository can be listed using the git tag command. Before listing all the tags it is required to ensure that the latest tag list from the remote repository has been fetched. On the other hand, even without pulling or fetching, it is possible to get a list of tags on the […]
Git stores configuration data in three different scopes: local, global and system. Using the git config command we can list all Git config settings as well as only local, global or system settings. For each scope, Git stores settings in different config files and it may be useful to know how to locate those files. […]
Sometimes it may be complex to debug Git errors, like “fatal: repository not found” or “fatal: authentication failed” with the default level of verbosity in Git. To debug different network, security, performance and many other issues in Git it is very helpful to know how to increase verbosity. In this note i am showing how […]
A Git commit ID is a 40 digits long SHA-1 hash, that can be abbreviated up to the shortest 4 digits version (7 by default). In this note i am showing how to abbreviate the long hash to a short hash in Git and how to display the abbreviated hashes in the outputs of the […]