Skip to content

Instantly share code, notes, and snippets.

@dutchiechris
Last active December 28, 2017 10:31
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 dutchiechris/1c9c11f27850e2f986dc6a547586d428 to your computer and use it in GitHub Desktop.
Save dutchiechris/1c9c11f27850e2f986dc6a547586d428 to your computer and use it in GitHub Desktop.
Common flow using git

Clone the desired repo:

git clone https://github.com/dutchiechris/fio-conf.git

Create a branch for your changes:

git checkout -b feature123

Make your changes and then review them:

git diff

Add all files to next commit:

git add .

Commit the files with a change message:

git commit -m "big change"

Check your branchname in case you forgot:

git branch

Push your branch to the server:

git push origin feature123

Automated tests are run when that branch was pushed to the server and its loaded in the dev environment

Or, if you are on a fork you can issue a PR back to the parent project from the GUI. Comment using #Issue to relate it to some open issue

Checkout master, merge the changes from your branch, push to the server:

git checkout master
git merge feature123
git push origin master

Automated tests are run when the commit to master was made and its loaded in the qa environment

Give it a tag and push to the server:

git tag 1.0.0
git push origin --tags

Automation sees tag and opens a PR for updating config for push to prod

Other misc stuff:

Test your app:

while true; do curl http://www.google.nl; sleep .5; done

To remove a local branch from your machine:

git branch -d BRANCH_NAME (use -D instead to force deletion without checking merged status)

To remove a remote branch from the server:

git push origin --delete BRANCH_NAME 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment