Git Commands Flashcards
git init
create a local git repository in directory
git add
move the local git repository to the staging area
git commit
commit the local repository to the remote repository
git config
set user name and email in main config file
> git config user.name –global
> git config user.email – global
git clone
clone git repository from URL
> git clone
git status
checks the status of the files you’ve changed in working directory, lists all the files that have been changed
git push
added and committed changes, want to push to remote
> git push
git pull
grab most recent code from remote
> git pull
git branch
lists out all the branches
git checkout
switch to another branch
> git checkout or git checkout -b to create and switch to new branch
git stash
save changes you don’t want to commit immediately
> git stash (in working directory), git stash apply (to get saved changes back)
git merge
merge another branch to your current selected branch
> git merge