Skip to content

Instantly share code, notes, and snippets.

@bichotll
Last active October 9, 2018 10:00
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 bichotll/175f7247baa5a45dfe793367ee1cb20b to your computer and use it in GitHub Desktop.
Save bichotll/175f7247baa5a45dfe793367ee1cb20b to your computer and use it in GitHub Desktop.
How to work properly with Git

How to work nicely and sound with Git (Gitlab/Github):

1 - Let's get our local updated before everything git fetch --all

2 - Now we start a new branch (from master!) git checkout origin/master (or git checkout upstream/master or similar depending on your setup) and git checkout -b feature-a

3 - Let's commit whatever the changes we have done git add . git commit -am "commit message"

4.1 - There are no changes on origin/master (we work alone) - we can push it to the git server git push

4.2 - There are changes on origin/master - we need to rebase git rebase -i origin/master and solve conflicts...

Once everything is solved you can push it to the server.

5 - Open Gitlab or Github and create a Merge/Pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment