Last active
August 26, 2020 19:09
-
-
Save GideonBabu/57adde3da9e121464437a149880564b7 to your computer and use it in GitHub Desktop.
Useful Git Commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git clone [git URL] - to clone the URL from gitlab/github/bitbucket | |
| git branch -a - to list current to remote branch | |
| git checkout [branch name] - to move/checkout to branch name | |
| git status - to view the status of the local files and remote branch files in cloud | |
| git diff [file] - to view the different between local and remove file | |
| git add [files with a space] - to add new files to the repo | |
| git commit -m "commit msg" - to commit with message | |
| git push - push the code to the repo | |
| # add remote | |
| git remote add [name] | |
| # show remote | |
| git remote | |
| # set upsteam for your forked repo | |
| git remote add upsteam [forked repo origin git URL(https/ssh)] | |
| #set upstream for master branch | |
| git branch --set-upstream-to=upstream/master master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment