Git Commands By Amazing Advait (हिंदी में)


Search

S.R. Copy Git Command Use Case
1 git clone https://github.com/username/repo-name.git GitHub से कोड डाउनलोड करना।
2 git init नया git प्रोजेक्ट शुरू करना।
3 git config --global user.name "Your Name" Git user का नाम सेट करना।
4 git config --global user.email "your@email.com" Git user की ईमेल सेट करना।
5 git status कौनसी फाइलों में बदलाव हुआ है यह देखने के लिए।
6 git diff बदलावों को compare करना।
7 git log --oneline --graph --all Commit history देखना।
8 git add . बदलावों को stage करने के लिए।
9 git commit -m "Message here" बदलावों को local repo में save करना।
10 git push origin branch-name Local commits को remote repo पर भेजना।
11 git pull origin main Remote से नया कोड लेना।
12 git pull origin main --rebase Cleaner history के लिए rebase करके pull करना।
13 git branch सभी ब्रांच देखना।
14 git branch new-feature नई ब्रांच बनाना।
15 git checkout branch-name किसी ब्रांच या commit पर जाना।
16 git merge other-branch दो ब्रांच को एक साथ जोड़ना।
17 git reset --hard HEAD~1 Commit undo करना (permanently)।
18 git revert <commit-id> कोई commit undo करना, लेकिन नए commit के साथ।
19 git stash बिना commit किए changes को छिपाना।
20 git stash pop छिपाए गए changes को वापस लाना।
21 git tag v1.0 Version के लिए tag बनाना।
22 git push origin v1.0 Tag को remote पर भेजना।
23 git cherry-pick <commit-id> एक specific commit को किसी और ब्रांच में merge करना।
24 git log पूरी commit history देखना।
25 git show <commit-id> किसी commit का detail देखना।
26 git rm filename Git से कोई file हटाना।
27 git mv oldname newname File का नाम बदलना।
28 git clean -f Untracked files हटाना।
29 git diff HEAD Current state और last commit का अंतर देखना।
30 git diff --staged Staged changes का difference देखना।
31 git shortlog Contributors और commits की summary देखना।
32 git archive --format=zip HEAD > code.zip Repo को zip file के रूप में export करना।
33 git reflog Recent HEAD movements देखना (recovery के लिए)।
34 git bisect start Bug कहाँ से आया ये खोजने की शुरुआत।
35 git blame filename कौनसी line किसने बदली, यह देखना।
36 git fetch origin Remote से नई जानकारी लाना, बिना merge के।
37 git fetch --all सभी remotes से जानकारी लाना।
38 git merge --abort Running merge को cancel करना।
39 git rebase -i HEAD~3 Last 3 commits को interactive रूप से change करना।
40 git remote remove origin Remote origin को हटाना।
41 git reset HEAD~1 Last commit को undo करना (soft reset)।
42 git reset --hard HEAD~1 Last commit और changes दोनों हटाना (hard reset)।
43 git checkout -- . Working directory में सभी local changes हटाना।
44 git log --oneline Compact commit history देखना।
45 git stash list Stash की गई सभी changes की लिस्ट देखना।
46 git stash apply Last stash को वापस apply करना।
47 git stash drop Stash entry को हटाना।
48 git stash pop Stash को apply करना और list से हटाना।
49 git diff branch1..branch2 दो branches के बीच अंतर देखना।
50 git merge branch-name दूसरी branch को current branch में जोड़ना।
51 git rebase branch-name Current branch को base से जोड़ना (clean history के लिए)।
52 git remote -v Configured remotes देखना।
53 git tag -l सभी tags की लिस्ट देखना।
54 git push --tags सभी local tags को remote पर push करना।
55 git tag -d v1.0 Local tag delete करना।
56 git push origin --delete v1.0 Remote tag delete करना।
57 git branch -r Remote branches देखना।
58 git branch -a All local और remote branches देखना।
59 git commit --amend Last commit को बदलना (message या content)।
60 git config --global alias.co checkout Git command का alias बनाना (e.g. `git co` for `checkout`)।
61 git shortlog सभी contributors की summarized commit log देखने के लिए।
62 git cherry-pick <commit> किसी specific commit को current branch में apply करने के लिए।
63 git blame <file> फाइल की हर लाइन किसने कब बदली, यह देखने के लिए।
64 git clean -f Untracked files को forcefully हटाने के लिए।
65 git reflog Recent HEAD movements को देखने के लिए, जब कुछ खो गया हो।
66 git archive किसी commit या tree को zip/tar फॉर्म में export करने के लिए।
67 git config --global user.name "Your Name" Global Git username सेट करने के लिए।
68 git config --global user.email "you@example.com" Global Git email सेट करने के लिए।
69 git describe --tags Commit को उसके tag के हिसाब से describe करने के लिए।
70 git show <commit> किसी commit की detailed जानकारी देखने के लिए।
71 git bisect start Bug ढूँढने के लिए binary search शुरू करने के लिए।
72 git bisect good
git bisect bad
Bisect में अच्छे और खराब commits मार्क करने के लिए।
73 git gc Repository को garbage collect और optimize करने के लिए।
74 git fsck Corrupted objects या issues detect करने के लिए।
75 git pull --rebase Pull करते समय history को cleaner रखने के लिए rebase करना।
76 git diff --cached Staged changes को compare करने के लिए।
77 git submodule add <repo> Repository के अंदर किसी दूसरे repo को submodule के रूप में जोड़ने के लिए।
78 git submodule update --init Submodule को initialize और update करने के लिए।
79 git worktree add <path> <branch> Same repo की दूसरी copy किसी अलग directory में रखने के लिए।
80 git remote set-url origin <new-url> Remote repository का URL बदलने के लिए।
81 git clean -fd Untracked files और directories को delete करना।
82 git rev-parse HEAD Current commit का SHA hash देखने के लिए।
83 git reflog HEAD या branch के इतिहास को देखना।
84 git show <commit-id> किसी commit की details देखना।
85 git archive --format=zip HEAD > code.zip Current branch का zip file बनाना।
86 git blame <file> किसने कौनसी line में बदलाव किया, यह देखना।
87 git grep <text> Repo में किसी text को search करना।
88 git bisect start Bug किस commit से आया, इसका पता लगाना।
89 git bisect bad Bug वाले commit को mark करना।
90 git bisect good <commit> अच्छे commit को mark करना जिससे पहले bug नहीं था।
91 git cherry दूसरी ब्रांच में कौनसे commit नहीं हैं, यह check करना।
92 git describe किस tag के आसपास commit हुआ है यह जानना।
93 git gc Git storage को optimize करना।
94 git shortlog Contributors की summary देखना।
95 git ls-tree -r HEAD Working tree की files को list करना।
96 git fsck Repo की integrity check करना।
97 git log -S <string> किस commit में कोई string जोड़ी गई थी, वह देखना।
98 git rm --cached <file> File को staging area से हटाना, repo से delete किए बिना।
99 git stash list सभी stashed changes की list देखना।
100 git stash drop कोई specific stash हटाना।
101 git add . && git commit -m "message" सभी नई और बदली हुई फाइलों को एक ही बार में stage और commit करना।