
Restores the most recently stashed files git stash pop Temporarily stores all modified tracked files git stash Lists all ignored files in this project git ls-files -other -ignored -exclude-standard gitignore suppresses accidental versioning of files and paths matching the specific patterns. Removes the file from version control but preserves the file locally git rm -cached Ĭhanges the file name and prepares it for commit git mv Ī text file named. Switches to the specified branch and updates the working directory git checkout Ĭombines the specified branch’s history into the current branch git merge ĭeletes the specified branch git branch -d ĭeletes the file from the working directory and stages the deletion git rm Lists all local branches in the current repository git branchĬreates a new branch git branch
GIT CONFIG GLOBAL COLOR UI AUTO SERIES
Name a series of commits and combine completed efforts. Records file snapshots permanently in the version history git commit -m ""

Unstages the file, but preserve its contents git reset Shows file differences between staging and the last file version git diff -staged Snapshots the file in preparation for versioning git add Shows file differences not yet staged git diff Lists all new or modified files to be committed git status


Review edits and craft a commit transaction. Start a new repository or obtain one from an existing URL.Ĭreates a new local repository with the specified name git init ĭownloads a project and its entire version history git clone Sets the email you want to be attached to your commit transactions git config -global user.email ""Įnables helpful colorization of command line output git config -global color.ui auto Sets the name you want to be attached to your commit transactions git config -global user.name ""

Configure ToolingĬonfigure user information for all local repositories. Git distributions for Linux and POSIX systems are available on the official Git SCM site. GitHub provides desktop clients that include a graphical user interface for the most common repository actions and an automatically updating command line edition of Git for advanced scenarios. This cheat sheet summarizes commonly used Git command line instructions for quick reference. # Set some settings in ~/.gitconfig - git_config : name : alias.ci scope : global value : commit - git_config : name : alias.st scope : global value : status # Unset some settings in ~/.gitconfig - git_config : name : alias.ci scope : global state : absent # Or system-wide: - git_config : name : alias.remotev scope : system value : remote -v - git_config : name : core.editor scope : global value : vim # scope=system is the default - git_config : name : alias.diffc value : diff -cached - git_config : name : color.ui value : auto # Make etckeeper not complain when invoked by cron - git_config : name : user.email repo : /etc scope : local value : ' ' # Read individual values from git config - git_config : name : alias.ci scope : global # scope: system is also assumed when reading values, unless list_all=yes - git_config : name : alias.diffc # Read all values from git config - git_config : list_all : yes scope : global # When list_all=yes and no scope is specified, you get configuration from all scopes - git_config : list_all : yes # Specify a repository to include local settings - git_config : list_all : yes repo : /path/to/repo.Git is the open-source distributed version control system that facilitates GitHub activities on your laptop or desktop.
