Command | Description |
---|---|
git init |
initialize the current working directory as a git repository |
git status |
check the status of the files in the current working git repo |
git add <file-name> |
add a file to be tracked in the repo |
git commit -m "message" |
commit the changes to the currently tracked files |
git remote add <name> <URL> |
add a connection from the local repo to a remote repo |
git remote -v |
check the names and URLs of the connected remote repos |
git push <remote> <branch> |
push the changes up to the remote repo |
git checkout -b <new-branch> |
create and immediately work on (checkout) a new branch |
git checkout <existing-branch> |
switch to working on another existing branch (checkout an existing branch) |
git branch // git branch -a |
list branches in local // list all branches local + remote |