Git CLI Documentation

git config --global user.name - Define the author name to be used for all commits by the current user. GIT CONFIG git config --global user.email - Define the author email to be used for all commits by the current user. git config --global alias. - Create shortcut for a Git command. E.g. alias.glog “log --graph --oneline” will set ”git glog” equivalent to ”git log --graph --oneline. git config --system core.editor - Set text editor used by commands for all users on the machine. arg should be the command that launches the desired editor (e.g., vi). git config --global --edit - Open the global configuration file in a text editor for manual editing.
Create empty Git repo in specified directory. Run with no arguments to initialize the current directory as a git repository. git init
Clone repo located at [repo] onto local machine. Original repo can be located on the local filesystem or on a remote machine via HTTP or SSH. git clone [repo url]
Stage all changes in directory for the next commit. Replace directory with a file to change a specific file. git add .
Commit the staged snapshot, but instead of launching a text editor, use [message] as the commit message..
List which files are staged, unstaged, and untracked.
Display the entire commit history using the default format. For customization see additional options.List which files are staged, unstaged, and untracked.
git branch : List all of the branches in your repo. Add a "branch" argument to create a new branch with the name "branch". git checkout -b branchname : Create and check out a new branch named branch also switch. Drop the -b flag to checkout an existing branch. git merge branchname : Merge branch into the current branch.
Create a new connection to a remote repo. After adding a remote, you can use name as a shortcut for url in other commands.
Fetch the specified remote’s copy of current branch and immediately merge it into the local copy.
Push the branch to [remote], along with necessary commits and objects. Creates named branch in the remote repo if it doesn’t exist.