Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- git log => show all commits
- git branch -a => show all branches
- git merge --squash branch-name => upload your changes to another branch
- <====================================================================>
- git checkout commit-id => switch to another commit (detached head)
- => commit changes and create a branch to save commit
- => merge a new branch to master branch then delete it
- <====================================================================>
- git checkout . => delete all changes in unstage
- git restore .
- git clean -df => delete all untracked files in unstage
- git checkout file.txt => delete all changes in unstage in specific file
- git reset . => switch from stage to unstage
- git restore --stage .
- git reset --soft HEAD~1 => delete a last commit and switch back to stage
- git reset HEAD~1 => delete a last commit and switch back to unstage
- git reset --hard HEAD~1 => delete a last commit and all changes
- git branch -D branch-name => delete a branch
- .gitignore => *.test: ignore all .test files
- => !log.test: exclude log.test file
- <====================================================================>
- git stash push -m "message" => save all changes and switch back to last commit
- git stash apply => go back to your changes
- git stash list => show all stash versions
- git stash apply stash-version => go back to your specific stash changes
- git stash pop stash-version => apply stash version then delete it from the list
- git stash drop stash-version => delete specific stash-version
- <====================================================================>
- git reflog => show all changes (commits, added, deleted)
- git reset --hard change-id => restore a deleted commit
- git checkout change-id => another way to restore (detached head)
- <====================================================================>
- git tag 1.0 commit-id => save a tag
- git show 1.0 => show commit-id
- git tag -d 1.0 => delete a tag
- git tag -a 2.0 -m "message" => tag a current commit
- <====================================================================>
- git pull => up to date all changes
- git checkout feat/cart => without remote/origin to create a branch and bind it with remote one
- => this step if I wanna go to his branch and make changes
Add Comment
Please, Sign In to add comment