-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgit-commands.txt
68 lines (51 loc) · 1.39 KB
/
git-commands.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
68
eval $(ssh-agent -s)
ssh-add ~/.ssh/<id_rsa_test>
git config user.name
git config user.email
git config --global user.name "<your-name>"
git config --global user.email "<your-git-email>"
git branch "new branch"
git checkout new-branch
git push -u origin new-branch
git checkout master
git merge "new-branch"
git checkout master
git tag v1.0
git push origin v1.0
git tag -d tagName
git push origin :tagName
git status
git init
git add .
git commit -m "messages"
git remote add origin git@github.com:cryptappz/demo.git
git remote show origin
git push -u origin master
git pull
git remote rm origin
git rebase --abort
git checkout -b feature-force-on-off
/*
|--------------------------------------------------------------------------
| Some Advance Git Command
|--------------------------------------------------------------------------
*/
# Add multiple files to git at the same time
git add file-1 file-2 file-3
# Get all git commit hash from a branch from latest to old
git log
# Exit from git text terminal
type q
# Get latest git commit hash from a branch
git log -n 1
# Get files name in a specific commit
git show --pretty="" --name-only <commit_sha>
# Get changes in a specific commit
git show <commit_sha>
# Push specific commit
git push origin <commit_sha>:master
# Foce push a specific commit
git push --force origin <commit_sha>:master
# Delete last commit
git log --oneline
git reset HEAD~1