Skip to content

Commit 43d358a

Browse files
committed
solution added for ques1
1 parent b09e16c commit 43d358a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
analysed the important and useful git commands
2+
3+
1. git init
4+
- Initializes the .git directory
5+
2. git add file.txt
6+
- Git creates a blob for the file content.
7+
- It also updates the index (staging area) which builds a tree structure for the next commit.
8+
3. git commit -m "First commit"
9+
- Git takes the tree from the index and creates a commit object that points to it.
10+
- This commit has a unique SHA, an author, and points to the previous commit (if any).
11+
4. git branch feature
12+
- Git creates a new pointer (ref) to the current commit.
13+
5. git checkout <branch>
14+
- Moves the HEAD to the branch. HEAD now points to that branch, which points to a commit.
15+
6. git merge main
16+
- Combines trees from both branches and creates a merge commit with two parents.

0 commit comments

Comments
 (0)