You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+80
Original file line number
Diff line number
Diff line change
@@ -23,3 +23,83 @@ LET ME COMMIT.hahaha
23
23
discard original codes to comply with the newest version
24
24
25
25
26
+
## What is Git?
27
+
Git is a distributed version control system designed to track changes in source code during software development. It is primarily used for coordinating work among programmers, but it can also be used to track changes in any set of files.
28
+
29
+
## Why use Git?
30
+
-**Tracking changes:** Keep a history of all changes made to your code.
31
+
-**Collaboration:** Work on projects with multiple people simultaneously.
32
+
-**Branching:** Create different versions of your project to experiment or work on different features.
33
+
-**Reverting:** Easily revert to a previous version of your code.
34
+
35
+
## Basic Commands
36
+
**Initialize a Git repository:**
37
+
## bash
38
+
```
39
+
git init
40
+
```
41
+
42
+
**Add a file to staging:**
43
+
```
44
+
git add <filename>
45
+
```
46
+
47
+
**Commit changes:**
48
+
```
49
+
git commit -m "Your commit message"
50
+
```
51
+
52
+
**Check status:**
53
+
```
54
+
git status
55
+
```
56
+
57
+
**View commit history:**
58
+
```
59
+
git log
60
+
```
61
+
62
+
**Branching:**
63
+
```
64
+
git branch <branch-name> # Create a new branch
65
+
git checkout <branch-name> # Switch to a branch
66
+
git merge <branch-name> # Merge a branch into the current branch
67
+
```
68
+
69
+
**Remote repositories:**
70
+
```
71
+
git remote add origin <remote-url> # Add a remote repository
72
+
git push origin <branch-name> # Push changes to the remote
73
+
git pull origin <branch-name> # Pull changes from the remote
74
+
```
75
+
**Additional Commands**
76
+
```git clone <url>```: Clone an existing repository.
77
+
```git diff```: Show the difference between commits, commit and working tree, etc.
78
+
```git reset --hard <commit-hash>```: Reset your current HEAD to the specified commit.
79
+
```git branch -d <branch-name>```: Delete a branch.
0 commit comments