-
git initto create a new repository under the current directory. -
git cloneto get a local copy of a repository.
-
git addto tell git the specified file(s) should be included in the next commit. -
git committo commit the "staged" changes in the repository. Use the-aoption to automatically stage all tracked files that were modified. -
git revertwill commit the inverse of the specified commit, effectively "cancelling it out".
-
git statusget information about the current state of the repository. -
git logget the (public) commit history of the repository. -
git reflogget the (local) history of operations on the repository.
-
git branchwill either enumerate all available branches without argument, or create a new branch with the name specified as argument. -
git checkoutwill switch to the specfied branch (the default branch is called "master"). -
git mergewill merge the specified branch in the current branch.
-
git remote add originspecify the default remote copy of the repository to use when "pushing" or "pulling" (not needed if the repository was created usinggit clone). -
git pullquery the latest changes from the default remote repository ("origin") and apply them to the current branch. (You can optionally specify which remote to query into which branch, e.g.git pull origin master.) -
git pushpush your local change to the default remote repository. (I didn't actually covergit pushbut it is common enough to show here.)
-
git lfs installwill setup the LFS extension in the current repository. -
git lfs trackwill track the files that satisfies the provided regular expression (make sure your ".gitattributes" file is tracked by git after this step).