Git Commands

Here is a list of some basic Git commands to get you going with Git.

Create a new local repository

Check out a repository

Add Files

If you mess up, you can replace the changes in your working tree with the last content in head:Changes already added to the index, as well as new files, will be kept.

Commit changes to head (but not to the remote repository)

Commit any files you’ve added with git add, and also commit any files you’ve changed since then

Send changes to the master branch of your remote repository

List the files you’ve changed and those you still need to add or commit

Displays the differences between versions and merge conflicts

Connect to a remote repository

List all currently configured remote repositories

Search the working directory for foo():

Instead, to drop all your local changes and commits, fetch the latest history from the server and point your local master branch at it, do this:

Former Software Engineer @axiatadigitallabs |SLIIT | Electrical and Electronic Engineering | Contact me —

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store