developer tools

GIT TOP Most Usefull Commands

GIT TOP Most Usefull Commands

$git init //Initialize a Local Git Repository
$ git add <file> / git add . //Add one or more files to staging area
$ git status //Check the status of your current repository and list the files you have made changes

$ git log  // Provides a list of all the commits made on your branch

$ git commit -m “commit messgae” //Commit changes to Index but not to the remote repository
$ git push origin <branch name> //Push the branch to the remote reposiotory so that other can use it
$git pull //git pull fetches all the changes from a remote repositry to a local repository
$ git clone //Creates a Git Repository copy from a remote source

$ git diff //View the chnages you have made to the file

$git config -global user.name “your_name” //Tell Git who you are by configuaring the author name

$ git config -global user.email <your_emailId> //Tell Git who you are by configureing the author name

$ git remote add origin <server> // Connect your local reposiotory to the remote server and add the server to be able to push changes to it

$ git branch <branch_name> // Create a new branch

$ git checkout <branch name> //Switch from one branch to another branch

$ git merge <branch name>//Merge a branch into the active branch

$ git rebase // Reapply commits on top of another base tip

To chnage remote Origin URL:
git remote set-url origin git://new.url.here

If You Appreciate What We Do Here On TutsCoder, You Should Consider:

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

Leave a Comment