-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitdemo.txt
67 lines (49 loc) · 1.3 KB
/
gitdemo.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
67
git init
//add changes to commit
git add File_name
//for adding all changes
git add -A || git add .
//commit before push
git commit -m "message"
//origin is a naming convention
//used by most
//conecting to remote server
git remote add origin URL
//pushing to server
git push origin master
//retreiving data from server
git pull origin master
//weather added to git add or not
git status
//changes made line by line
git diff
//told you so
git commit -m "fix"
//log of all commits
//includes author, time and others
git log
//same as log,includes changes too
git log -p
// Q to exit log
//Now Something Advance
//not too much
#branching
//do git pull first before push if
//you are expecting collaberators
git branch Branch_Name
git branch //to list branches
//asterisk(*) in working branch
git checkout Branch_Name //to change working branch
git add,commit //same as above
//Remember below comment
//Its not master,its Branch_Name
git push orgin Branch_Name
//committing changes in branch to master
git checkout master
git pull orgin master //to get changes in master,Like collaberators
git branch --merged //merged branches till now
git merge Branch_Name
git push orgin master
//deleting branch
git push orgin --delete Branch_Name //delete branch_name in remote
git branch -d Branch_Name