We can use Git through the command line as well as through its graphical user interface (GUI). Git is free and one of the most widely used version control systems. Git is a version control system that tracks the changes in the code, documents, and other important information regarding a certain code base (or project), etc. There are two types of Version Control systems namely - Centralized Version Control Systems ( CVCS) and Distributed Version Control Systems ( DVCS). Version Control SystemsĪ version control system is a tool in software development that tracks the changes in the code, documents, and other important information regarding a certain code base (or project), etc. Let us discuss them briefly before learning about the git tag command. The prerequisites for learning the git tag command can be a basic understanding of Version Control Systems, Branching, and Git. So, if we are working on project development and we have created the first version of our project then we can mark the tag here (for example v1.1) and continue working on the development process. The git tag is mainly used to mark the starting point in project development. Hook the two together with git remote add, and push your brand new clean repository to the branch new clean remote.A git tag is used to mark some point in the git history. Also throw your remote away and make a fresh remote. Then say git init and start all over with a fresh commit. Īnd that's why the simplest way to do what you want to do is just to checkout the state of things that you like, which is presumably main, and then just throw the entire. For every remote-tracking branch, you'd need to say git push -delete origin. You'd need to delete all those remote branches too! But you can't just delete them you have to push the deletion. Plus, you'd need to say git tag -list to find out what tags you have, and delete each of those tags.īut even that wouldn't be enough, because what about all the remote-tracking branches you have? To see those, you'd say git branch -remote. So, to do it correctly the way you did it, you would need to say git branch to find out what branches you have, and delete each of those branches. git folder didn't get significantly smaller after what you did. So what you did probably didn't cause any commits to die!Īnd that would explain why your. So that origin/main is keeping all your commits alive, all the way back to the root commit. So in addition to your main, you've also got an origin/main. So you also have remote-tracking branches that mirror the state of that remote. So let me ask you this: was main the only branch you had? Because if it wasn't, then all those other branch names still exist, and they are keeping all their parents alive all the way back to the root commit. You deleted main, in the hopes that this would cause all existing commits to die. Okay, so now let's talk about what you did. In other words, imagine a chain of commit parentage well, a commit can only die if no chain of commit parentage starting with a branch or tag name reaches it. If that's how a commit can't die, how can a commit die? Well, for a commit to die, it would have to be the case that no branch or tag name points to a commit that calls this commit its parent at any depth. If commit is the parent of a commit that is alive, it cannot die. If a commit has a name - that is, a branch name or tag name points to it - it cannot die. So is a tag name.Įvery commit has at least one "parent" - except for the very first commit you ever made (the "root" commit) and any "orphan" commits that you may create. Here's what you need to know:Ī branch is merely a name for one commit. To understand that, you need to know how commits can't die. To discover the answer, let's talk about how commits die. Why didn't the thing I did reduce the size of the. I take it that the real questions here are:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |