Cheatography
https://cheatography.com
Git commands for day to day life
Working with Branches
|
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 |
|
Working with Remote
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 |
|
Order of Work
|
git clone [repository_url]
|
git checkout -b [branch_name]
|
make modifications |
git add [file_or_directory]
|
|
git push [remote_name] [branch_name]
|
create pull request on UI |
|
|
git push [remote_name] [branch_name]
|
|
Initializing, Staging and Commiting
|
Initialize the repo on git |
git clone [repository_url]
|
Clone an existing repo |
git add [file_or_directory]
|
Stage changes for commit |
|
Commit with short message ( -m
) |
|
Retorna para unstage |
|
Tira arquivo do stage |
|
|
Info
|
Check the status of changes |
|
View commit history |
git diff [commit1] [commit2]
|
Show changes between commits |
|
Show changes between working directory and last commit |
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets