-
Notifications
You must be signed in to change notification settings - Fork 0
/
git_commands
53 lines (38 loc) · 1.15 KB
/
git_commands
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
- set user name
$ git config --global user.name <name>
- set user email address
$ git config --global user.email <email>
- initialise default git
$ git config --global init.default bransh main
$ git init
- to track the files
$ git add <name of the file>
- to track all the files
$ git add .
$ git add --all
$ git add -A
- the check the stats
$ git status
- to untrack the file
$ git rm --cached <file name>
- to ignore files from getting changed when adding and commiting
-- Create a file named <.gitignore> then inside the file type *txt to ignore all .txt files
<<<<<<< HEAD
- commit <taking a snapshot of this repository in this current point in time>
$ git commit -m "commit message"
- to see the differences when chainging a file
$ git diff
-- Branches
- Create a new branch
$ git branch <branch Name>
- swich between branches
$ git switch <branch Name>
$ git checkout <branche name>
=======
-- commit <taking a snapshot of this repository in this current point in time>
$ git commit -m "commit message"
-- to see the differences when chainging a file
$ git diff
# ADDED COMMENT TO CHECK MERGE #
>>>>>>> make_changes
# Added change from git "comment"