Git | Frequently used commands

To check for any changes in the files.

View Change history and comments.

To see the change history per file

See changed files history

Commit the change

To revert back a commit

To create a clone of your local repository

To create a bare clone(A clone with the .git database alone) as a central repository

To see remote branches

Add/remove a remote branch

Push local changes to remote branch


If you want to start tracking a remote branch with git status command, run below command.



After Git pull, if you encountered below output.

There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details

If you wish to set tracking information for this branch you can do so with:

—————

Sherbaz@SHERBAZ-PC /s/Softwares/Open Source/linuxKernel (master)
$ git status
On branch master

Initial commit

nothing to commit (create/copy files and use “git add” to track)

—————-

$ git branch –set-upstream-to=Origin/master master
fatal: branch ‘master’ does not exist

—————-

$ git checkout -b master -t origin/master
error: unable to create file drivers/gpu/drm/nouveau/core/subdev/i2c/aux.c (No s
uch file or directory)
Checking out files: 100% (47503/47503), done.
D       drivers/gpu/drm/nouveau/core/subdev/i2c/aux.c
Branch master set up to track remote branch master from origin.
Already on ‘master’

Author: Sherbaz

Being a gadget enthusiast, He always felt good to try new programming languages and techniques. But never goes in-depth anywhere. www.SplitExpense.in was found when he tried php, html, javascript and mysql. Being an electronics engineer, he is also interested to build small gadgets and tools in embedded and digital electronics. As a profession, he handles microsoft sql server database and calls himself a database administrator

Leave a Reply