Senior
What is the difference between a tag and a branch in Git?
sobes.tech AI
Answer from AI
In Git, a tag is a pointer to a specific commit, usually used to mark releases or important versions. Tags are static and do not change after creation.
A branch is a movable pointer to a commit that evolves as new commits are added. Branches are used for developing new features, fixes, and allow parallel work on different tasks.
Example:
- The master branch is constantly updated with new commits.
- The v1.0 tag points to a specific commit corresponding to the 1.0 release and does not change.