Skip to content

Instantly share code, notes, and snippets.

@GideonBabu
Last active August 26, 2020 19:09
Show Gist options
  • Select an option

  • Save GideonBabu/57adde3da9e121464437a149880564b7 to your computer and use it in GitHub Desktop.

Select an option

Save GideonBabu/57adde3da9e121464437a149880564b7 to your computer and use it in GitHub Desktop.
Useful Git Commands
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