File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Anirudh/missing_semeter_git/question1 Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 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.
You can’t perform that action at this time.
0 commit comments