git branch |
List branches
|
git branch [branch_name] |
Creates new branch
|
git checkout -b [branch_name] |
Creates and switch to a new branch
|
git checkout [branch_name] |
Switch to branch
|
git branch -d [branch_name] |
Deletes branch
|
git branch -m [old_name] [new_name] |
Renames branch
|
git remote add [remote_name] [repository_url] |
Add a remote repo
|
git pull [remote_name] [branch_name] |
Pull changes from a remote repo
|
git push [remote_name] [branch_name] |
Send changes to a remote repo
|
git init |
git clone [repository_url] |
git checkout -b [branch_name] |
|
make modifications
|
git add [file_or_directory] |
git commit -m 'message' |
git push [remote_name] [branch_name] |
|
create pull request on UI
|
git fetch origin |
git pull origin main |
git push [remote_name] [branch_name] |
git init |
Initialize the repo on git
|
git clone [repository_url] |
Clone an existing repo
|
git add [file_or_directory] |
Stage changes for commit
|
git commit -m 'message' |
Commit with short message (
-m) |
git reset |
Retorna para unstage
|
git reset [commit] |
Tira arquivo do stage
|
git status |
Check the status of changes
|
git log |
View commit history
|
git diff [commit1] [commit2] |
Show changes between commits
|
git diff |
Show changes between working directory and last commit
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.