
Git Cheatsheet
This cheatsheet lists commands we use to submit a PR (pull request) to a GH (github) repo. It is mainly for my reference, but if you found it helpful, leave a like! git checkout -b *branch_name* Creates and switches to the new branch git checkout - switch to the previous branch git status to check files that have been changed git diff shows the code difference in the terminal git add . to stage all files for commit git commit -m "*commit message goes here*" to commit the changes You can use git commit and then you’ll be redirected to either nano or vi editors to enter the commit message. For nano editor: Type message, ^X to exit the file and y to save the file. For vi editor: i for insert mode, type the message and then ESC. :wq to save text and exit, or :q to simply exit git push --set-upstream origin *branch_name* to push the branch and changes. git push works too, but you have to mention the branch_name the first time you push changes. Revert commits before they are
Continue reading on Dev.to Webdev
Opens in a new tab



