So, in git to isolate different versions of code we have branches. Make changes in the code, and then once the changes are finalised, you will replace the code in the main folder right? Let us understand how we can do the above thing in git. So, what do you do? Ideally, you will copy the code of this website in a new folder. But if you are changing the code, you do not want the changes to be reflected in the main website which is deployed. For this, you will have to change the code of the website. You want to add more features to this website. The website looks something like this.įig 3: Sample example of the website before changes Let us take an example to understand this, Let’s say you have a website that is currently running. So whenever we make any change, it generates a new commit.įig 2: The changes made in the repository will be saved as a new commit with a new commit id What is a Branch?Ī Branch is a representation of different isolated versions of code. These changes in git will be saved as another commit with another commit-id 14343. Now let us say we have made some changes to the code by adding another python file. Each commit has a commit-id, let it be 1234 in our case. These four python files will be saved inside a commit. In Fig: 1, Let us assume that we have four python files. Let us take an example and discuss in brief from the diagram shown below:įig 1: The changes made are saved in a commit What is a Commit?Ĭommit is defined as the location where the code and its changes are stored. Let’s understand these two terms respectively.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |