-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.txt
69 lines (43 loc) · 1.58 KB
/
test.txt
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
54
55
56
57
58
59
60
61
62
63
64
65
66
all files : ls / ls -a
directory : mkdir
user-name : git config --global user.name
email address: git config --global user.email
clone : git clone url
status : git status
add : git add .
commit : git commit -m "message"
push : git push origin main
---------------------------------------------
working with git after folder create at locak machine
init : git init
create file and directory : touch filename/mkdir dirname
git add ., git commit -m "message"
remote add : git remote add origin url
to verify remote : git remote -v
to check branch : git branch
to rename branch : git branch -M main (main is a branch name and master---> main)
to push : git push origin main or (git push -u origin main --> after : git push)
---------------------------------------------
to check branch : git branch
to rename branch : git branch -M main
to navigate : git checkout <-branch name->
to create new branch : git checkout -b <-new branch name->
to delete branch : git branch -d <-branch name->
--------------------------------------------
way 1 ::::
to compare commits,branches,files & more : git diff <-branch name->
to merge 2 branches : git merge <-branch name->
way 2 ::::
create a PR
----------------------------------------
merge conflicts
----------------------------------------
Undoing Changes ::::
Case 1: staged changes ::
git reset <-file name->
git reset (for all)
case 2: commited changes(for one commit)
git reset HEAD~1
case 3: commited changes(for many commits)
git commit <-commit hash->
git reset --hard<-commit hash->