A release” in Git (and GitHub) usually refers to a stable, packaged version of your project that’s ready to use so that it can be used by customers or other developers.
The underlying technology that makes a release possible in Git is the Git Tag.
A tag is a permanent, fixed reference (like a label) to a specific commit in your repository's history. Unlike branches, which move forward with new commits, a tag always points to the exact same commit forever.
Command: You create a tag using the git tag command, usually following v1.0.0, v2.1.5).
# Create an annotated tag (recommended for releases) git tag -a v1.0.0 -m "Initial stable release" # Push the tag to the remote repository git push origin v1.0.0
In Git, tags are mainly of two types:
1️⃣ Lightweight Tag
-
Think of it as a bookmark to a specific commit.
-
Just points to a commit without any extra metadata.
-
No author, date, or message attached.
Example:
-
v1.0now points to the current commit. -
Quick and simple, but not ideal for release notes or annotations.
2️⃣ Annotated Tag
-
A full-fledged tag stored as a Git object.
-
Can contain:
-
Tagger name & email
-
Date
-
Message
-
Can be signed with GPG for verification
-
Example:
-
-a→ annotated tag -
-m→ tag message
You can see details with:
💡 Common Release Assets (Binaries)
Desktop Software .exe file (Windows installer), .dmg file (macOS), .deb or .rpm package (Linux).
Web/Library A pre-compiled .zip or .tar.gz file containing the minified JavaScript/CSS, or a pre-built static site.
Game The final, compiled game folder or installer.
Simple Script/Tool A bundled .jar file, a Python wheel (.whl), or a compiled single binary.
As I was using /var/www/html as my git repository and The standard way to create a .tar.gz archive (also known as a "tarball") for your Apache web directory on Linux is by using the tar command with the appropriate flags.
[root@devopsvm01 html]# tar -czvf web_backup_$(date +%Y%m%d).tar.gz /var/www/html/
tar: Removing leading `/' from member names
/var/www/html/
/var/www/html/about.html
/var/www/html/index.html
/var/www/html/.git/
/var/www/html/.git/branches/
/var/www/html/.git/hooks/
.
.
/var/www/html/.git/ORIG_HEAD
/var/www/html/.git/REBASE_HEAD
/var/www/html/.git/COMMIT_EDITMSG
/var/www/html/main.html
/var/www/html/services.html
/var/www/html/news.html
/var/www/html/product.html
/var/www/html/offer.html
/var/www/html/web_backup_20251103.tar.gz
[root@devopsvm01 html]#
Get the web_backup_20251103.tar.gz to your local PC.
user@DESKTOP-0AVRJL4 MINGW64 ~/Downloads
$ scp root@192.168.0.222:/var/www/html/web_backup_20251103.tar.gz .
The authenticity of host '192.168.0.222 (192.168.0.222)' can't be established.
ED25519 key fingerprint is SHA256:zoi5Ra/kqhxDCOC67Th8169lRa5t8vqZ2i4tKCfzWJA.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.0.222' (ED25519) to the list of known hosts.
root@192.168.0.222's password:
web_backup_20251103.tar.gz 100% 57KB 3.7MB/s 00:00
user@DESKTOP-0AVRJL4 MINGW64 ~/Downloads
$
Why your local git tag doesn’t show the tag
-
You created the tag on the remote (e.g., GitHub web UI).
-
Your local repo doesn’t know about new remote tags until you fetch them.
-
git tagby default only lists local tags, not remote tags.
How to see remote tags locally
-
Fetch all tags from remote
-
This will download all tags from the remote and add them to your local repo.
-
Verify tags
-
Now your locally created tags (from remote) should appear.
Optional: Checkout a tag
If you want to work on that release tag:
-
Example:
-
This will put your repo in a detached HEAD state, meaning you are not on any branch — just viewing that commit.
No comments:
Post a Comment