Github workflow
In order to keep track of versions of your code, or just to keep a record of the changes you make to code, github.com is an alternative VCS to the popular SVN. Here are some steps to ensure your code is kept up to date, even if you are sharing your codebase with other developers.
- Step 1. Setting up a local copy of the project (Do this first time only)
git clone git @ github.com:< project >.git < foldername >
- Step 1a. If there is a branch saved to github
git checkout --track -b < branchName > origin/< branchName >
- Step 2. Ensuring you have the latest code changes (Usual starting point)
git pull
- Step 3. Create a safe place to work locally
git branch < local_branchName >
- Step 4. Move to the safe haven
git checkout < local_branchName >
- Step 5. Do some work
- Step 6. Log any new files
git add .
- Step 7. Log any changes to existing files
git commit -am "< Your comments >"
- Step 8. Flip into the master record or replace master with if you are working to the branch
git checkout master
- Step 9. Check the master records are up to date
git pull
- Step 10. Do this only if new changes have been pulled through otherwise skip to Step 14.
git checkout < local_branchName >
- Step 11. Bring the new changes into your local safe haven
git merge master
- Step 12. Only If git reports any conflicts do this
git mergetool
- &
git commit -am "< A new comment >"
- Step 13. Go back to Step 8.
- Step 14. Update the master records to include your changes
git merge < local_branchName >
- Step 15. Save your changes to the online repository
git push
- Step 16. Remove your temporary workspace
git branch -d < local_branchName >
Comments
James (not verified)
Sun, 12/02/2012 - 11:34
Permalink
Nice a single, thank you for the tip
Quite good article, the post gave a lot of information. Thanks
The fattest WSS... (not verified)
Sun, 13/05/2012 - 09:33
Permalink
Github workflow | Tech | Gareth Alexander
I will right away grab your rss as I can not find your e-mail subscription
link or e-newsletter service. Do you have any? Kindly let me
know in order that I could subscribe. Thanks.
gareth
Sun, 05/08/2012 - 12:33
Permalink
Yeah, I don't really have any
Yeah, I don't really have any time to keep up this blog, let alone write an email newsletter, sorry.
Raymondmar (not verified)
Sat, 18/02/2023 - 14:45
Permalink
Im glad I finally signed up
Hey there! Do you know if they make any plugins to protect against hackers? I'm kinda paranoid about losing everything I've worked hard on. Any suggestions?
gareth
Sun, 18/06/2023 - 20:03
Permalink
Yes, I do. Use a properly
Yes, I do. Use a properly configured and up to date Wordpress or Drupal site and you should be good.
Add new comment