forked from AbhreshSugandhi/GitTutorial
-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathGitSyntax.txt
More file actions
86 lines (67 loc) · 1.3 KB
/
Copy pathGitSyntax.txt
File metadata and controls
86 lines (67 loc) · 1.3 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Initiate the directory
git init
Create
Dir
mkdir project.git
File
touch newFile.txt
echo “This text is added to the end of the file” >> newFile.txt
Clone
git clone gituser@git.server.com:project.git
git clone <repository link>
Perform changes
Appending changes
echo "abcd" >> File Name
replacing changes
echo "abcd" > File Name
Review changes
git status
git log
git show (commit id)
git diff
Commit and changing commit
git commit Filename -m "Message"
git commit --amend -m "Filename"
Push Operation
git push origin master
git push link of remote repository
*Stash operation
git stash
git stash list
git stash pop
Move operation
git mv File name location
*Rename operation
git commit -a -m 'Added Makefile and renamed OldfileName to
NewfileName
*Delete
git rm <filename>
*FixMistakes
??
*Tag
$ git tag
git tag TagName
git push --tags
git show TagName
*Patch
Create patch file
git format-patch master --stdout > newFile
apply patch
git apply --stat FileName.patch
*Branch
git branch
git branch BranchName
git checkout BranchName
git checkout -b NewBranchName
git checkout -d NewBranchName
git branch -m new_branch RenamedBranchName
*Merging
git merge BranchName
git merge BranchName --no-commit
Remote
git remote add origin Link
Fetch
git fetch RemoteName
*remove directory
rm -rf DeleteFolderName
*git .ignore