Skip to content

Instantly share code, notes, and snippets.

@shaheerakr
Last active October 9, 2019 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shaheerakr/96adecc6816206e4813595d9e228119f to your computer and use it in GitHub Desktop.
Save shaheerakr/96adecc6816206e4813595d9e228119f to your computer and use it in GitHub Desktop.
Git commands with there use cases
# merging remote master into local master
> git checkout master
> git pull origin master
# merging local master into a local branch updating remote branch
## it is recomended to make the local master even to its remote before running these commands, to do this step see the above case
> git checkout <branch-name>
> git merge master
> git push origin <branch-name>
# commit and push changes into local branch then to remote
> git add .
> git commit -m"message"
> git push origin <branch-name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment