dating servive - Updating the currently checked out branch this may cause confusion

And if you do update HEAD manually, you'll see something you might not expect: a lot of files in your worktree will be dirty.This is because updating the ref does not change the file contents, so git now thinks something else is checked out than what the files represent and considers them all dirty.There is also special fetch and push behaviour for tags, which is explained below.

Let's start with the one thing that's the same for all of them: you can use them anywhere git expects something that looks like a commit.

So Symbolic refs do not point to an object, but to another ref; similar to how symlinks work (and initially they were actually implemented as symlinks).

Git's simple objects-and-refs model allows you to be very creative in naming your things and putting them in groups.

For instance, all branches have names starting with refs/heads/, tags all start with refs/tags and so on.

The information about when a branch pointed where is not stored anywhere in the git history.

Mostly because it's irrelevant in the big picture, but also because it can be seen as private data.

So how many types of refs are there and how do they differ?

Turns out, quite a few, and with quite a few differences!

Here's an example reflog of one of my personal projects.

As you can see every action that changes where the ref points to is stored.

A tag object contains a tag message (for example "Version 1.0"), a pointer to a commit, tree or blob, and possibly a GPG signature.

Tags: , ,