Skip to content

Commit af52a20

Browse files
author
TechMainul
committedOct 20, 2020
what's new
1 parent 50f34ea commit af52a20

3 files changed

+126
-0
lines changed
 

‎gitCodes/Git Commands.txt

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
17. Check git install version-
2+
git --version
3+
4+
19. How to initialize-
5+
git init
6+
7+
20. How to config git username and email-
8+
git config --global user.name "____"
9+
git config --global user.email "____"
10+
11+
20. How to config New username and email-
12+
git config user.name "____"
13+
git config user.email "____"
14+
15+
21. Check git username and email-
16+
git config --list
17+
18+
22. Use of git status-
19+
git status
20+
21+
23. How to stage changes (file add)-
22+
git add ('file name'
23+
or use '.' dot
24+
or --all)
25+
26+
24. How to commit-
27+
{git commit
28+
press 'i' text file added
29+
press 'ESCP'
30+
press ':x'}
31+
32+
git commit -m "your comment here"
33+
34+
25. List all changes/commits using git log-
35+
All changes-
36+
git log
37+
git log -oneline
38+
39+
26. Use of git checkout-
40+
git checkout "serial number"
41+
42+
27. Use of git diff-
43+
git diff
44+
45+
28. Use of git show-
46+
git show "serial number"
47+
48+
29. See diffrence between two commits-
49+
git diff "serial num' 'serial num"
50+
51+
30. Use of git diff stagged- (after commit)
52+
git diff --staged
53+
54+
31. Remove/Delete files using git rm and reset HEAD- (after delete your file please commit it)
55+
git rm 'file name'
56+
git reset HEAD 'file name'
57+
58+
39. Push using SSH Key- (https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)
59+
60+
61+
40. How to clone-
62+
copy clone link & paste command section
63+
64+
41. How to fecth and pull-
65+
66+
42. Git Branching-
67+
git branch 'right yout branch name is here'
68+
69+
git branch
70+
git checkout 'switching branch name'
71+
72+
git checkout -b 'new branch name'
73+
74+
git merge 'main & other branch name"
75+
76+
git branch -D 'branch name for delete'
77+
78+
43. How to git stash and clean-
79+
git stash
80+
git stash pop (view previous code)
81+
git stash apply (for merge all)
82+
83+
git stash list
84+
git stash pop 'serial num' (for go specific stash)
85+
86+
git clean -f -n
87+
git clean 'serial text'
88+
89+
44. How to use .gitignore- (if you wanr .scss or .sass file)
90+
touch .gitignore (after create git ignore file then open those file then type file exrention)
91+
92+
45. How to fork (copy github project) in github-
93+
click folk button
94+
check your repository
95+
96+
46. How to create pull request-
97+
create new repository
98+
create branch
99+
propose new file
100+
Crate pull request-
101+
102+
103+
104+
105+
106+
107+
108+
109+
110+
111+
112+
113+
114+
115+
116+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
echo "# hello" >> README.md
2+
git init
3+
git add README.md
4+
git commit -m "first commit"
5+
git branch -M main
6+
git remote add origin https://github.com/TechMainul-dev/hello.git
7+
git push -u origin main
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
git remote add origin https://github.com/TechMainul-dev/hello.git
2+
git branch -M main
3+
git push -u origin main

0 commit comments

Comments
 (0)
Please sign in to comment.