Git Basic Command List

Serial Git Command Description Tags
1 git init Initialize git repository in a folder init,start git,open git
2 git status Information about changed/deleted files status,condition,changes,modify
3 git config username.name Jhon Config git user for the current git git, config, user,name
4 git config username.email jhon@gmail.com Config git email for the current git git, config, user,email
5 git config --global username.name Jhon Config git user for the current git globally in a machine setup,config, globally, user,name
6 git config --global username.email jd@gmail.com Config git email for the current git globally in a machine setup,config, globally, user,email
7 git remote add origin https://github.com/arif98741/gitcom Config remote connection for uploading files and data to the repository(such as github, gitlab, bitbucket, sourceforge) setup,origin,remote,server,repo
8 git -v Current installed git version git,version,show
9 git add file.txt Add specific file for commit add, fixed, specific, custom file
10 git add   . Add all changed file for commit add, all, every file, changed
11 git commit -m "commit message" Commit Changes with messages and information commit, change, -m
12 git branch See all local branch list branch, list, local
13 git branch -a See all local and remote branch branch,remote, list,all, local
14 git branch -r See all remote branch list remote,all, list,branch
15 git branch branch_name Create new branch locally branch, change, make, create
16 git checkout -b branch_name Create new branch and move to there create, move, branch, checkout
17 git checkout -b branch_name
or
git push origin branch_name
Create new branch locally and push it to origin branch, change, make, create
18 git checkout dev Migrate from any branch to dev create, move, branch, checkout
19 git push Push current changed commits to current branch where you are push, commit, master
20 git push -u origin master Push current changed commits to master branch push, commit, change,master
21 git push -u origin branch_name Push current changed commits to specific branch specific,fixpush,branch,commit, change,master
22 git log show all commits with details git,log, change, commit,all
23 git log --oneline show all commits with summary log,change,commit,summary
24 git rev-list --all show all commits with commit long id git,log, change, commit,all
25 git rev-list --all --count Show number of commits count, number, how many, log
26 git shortlog Show number of commits with summary log,number,commit,list
27 git shortlog -s Show number of commits per user user,commit,change,log,list,count,number
28 git pull update local branch by fetching data from remote origin pull, update,remote ,origin
29 git tag Show all local tag list tag, list, all, tags
30 git ls-remote --tags origin Show all remote tag list tag, list,remote, origin, all, tags
31 git tag tag_name Create a new tag locally tag, create, new, local
32 git checkout tags/tagname Checkout to new tag tag, checkout, new,
33 git tag tag_name -a
or
git push origin --tags
Create a local tag and upload to origin origin, tag, remote
34 git push --tags Push all tags to the remote push, tag, all, --tags
35 git tag tag_name -a Create a new tag with nesscessary description -a, tag,create, make
36 git tag -d tag_name Delete local tag tag,delete,clear, local
37 git push origin :tagname
or
git push --delete origin tagname
or
git push origin :refs/tags/tagname
Delete remote tag tag, delete, push, origin
38 git fetch --tags Fetch and update local tags from remote origin tag,fetch,remote,origin
39 git merge feature Merge master branch with feature sub brach master,rebase, feature,sub, child
40 git rebase feature Rebase feature branch with master branch rebase, feature, master, merge, change
41 git reset Unstage All Added Before Commit Done stage, unstage, git, commit