Question

In: Computer Science

In git, the term "branch" and the term "commit" mean exactly the same thing (i.e. all...

In git, the term "branch" and the term "commit" mean exactly the same thing (i.e. all branches are commits, and all commits are branches)?

Solutions

Expert Solution

Ans . No, a Branch in a git is simply a moveable pointer to the commits. By default the branch name in git is master.when you start making commits you are given a master branch that points to the last commit you made every time when you commit the master branch pointer move forward

If i explain you in simple words Commit is like a diary entry and Branch is just like having a second dairy

A commit marks a point in a time , state and in a record.You can make lots of commits over the life of the project.

We can say a branch is like a duplicate dairy where you can write your first draft before merging them all into your Master or Main dairy

We can also say commiting means to create a revision , normally on a branch(it's not compulsory in git) and in Git Branches are just pointer to revision.

A typical book answer will be

A branch can be also thought of as a pointer to Commit.we can also use term Branch to refer the set of commits comprised by the commite being pointed to and all of its ancestors.

The commit as re arranged in a tree manner where each commit(except first on) have one or more ancestor commits

Branching is just simply adding a new pointer which is pointing to some of commits.it does not change the tree of commits in any ways


Related Solutions

What exactly do we mean by the term WEALTH? Why is it important?
What exactly do we mean by the term WEALTH? Why is it important?
Inflation and deflation describe long-term trends in prices. Inflation means that the same thing will cost...
Inflation and deflation describe long-term trends in prices. Inflation means that the same thing will cost more in the future, while deflation means they cost less. When a business decision span several years these concepts need to be address. How would you account for them in your business decision analysis?
What does Foot mean when she claims that the word good means the same thing when...
What does Foot mean when she claims that the word good means the same thing when applied to features of humans as when applied to features of plants?
“All experienced auditors would design exactly the same audit program for a particular audit engagement.” Do...
“All experienced auditors would design exactly the same audit program for a particular audit engagement.” Do you agree? Explain. Remember to complete all parts of the problems. Do not forget to show the necessary steps and explain how you attained that outcome.
Consider a rhombus that is not square (i.e., the four sides all have the same length, but the angles between sides is not 90°).
Consider a rhombus that is not square (i.e., the four sides all have the same length, but the angles between sides is not 90°). Describe all the symmetries of the rhombus. Write down the Cayley table for the group of symmetries,
When data are normally distributed, the mean, median, and mode: all have the same value are...
When data are normally distributed, the mean, median, and mode: all have the same value are useful for examining the spread of scores should never be used together vary randomly
Your portfolio allocates equal amounts to three stocks. All three stocks have the same mean annual...
Your portfolio allocates equal amounts to three stocks. All three stocks have the same mean annual return of 13 percent. Annual return standard deviations for these three stocks are 30 percent, 40 percent, and 50 percent. The return correlations among all three stocks are zero. What is the smallest expected loss for your portfolio in the coming year with a probability of 2.5 percent? (Negative value should be indicated by a minus sign. Do not round intermediate calculations. Enter your...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT