Difference between revisions of "Git"
From Wiki2
m |
|||
Line 1: | Line 1: | ||
===git=== | ===git=== | ||
==== | ====the task==== | ||
The idea is to have production code on soupteam.com and then a copy of that code on localhost hpc. That copy has a branch that you can try fixes in. When they are ready to go live then you push them to github and merge. Ifit doesn't work out you can role back. | The idea is to have production code on soupteam.com and then a copy of that code on localhost hpc. That copy has a branch that you can try fixes in. When they are ready to go live then you push them to github and merge. Ifit doesn't work out you can role back. | ||
Started by cloning (which creates a remote named 'origin') | ====the setup==== | ||
Started by cloning code on your local machine(which creates a remote named 'origin') | |||
$ git clone git@github.com:mckennatim/OBsoup.git | $ git clone git@github.com:mckennatim/OBsoup.git | ||
Then | Then create a branch for putting new features: | ||
$ git checkout -b loco | $ git checkout -b loco | ||
Switched to a new branch 'loco' | Switched to a new branch 'loco' | ||
====normal test process | ====normal test process==== | ||
=====locally===== | =====locally===== | ||
do some editing locally on a (loco)branch and test locally then add. and commit locally | do some editing locally on a (loco)branch and test locally then add. and commit locally |
Revision as of 14:23, 8 December 2011
git
the task
The idea is to have production code on soupteam.com and then a copy of that code on localhost hpc. That copy has a branch that you can try fixes in. When they are ready to go live then you push them to github and merge. Ifit doesn't work out you can role back.
the setup
Started by cloning code on your local machine(which creates a remote named 'origin')
$ git clone git@github.com:mckennatim/OBsoup.git
Then create a branch for putting new features:
$ git checkout -b loco Switched to a new branch 'loco'
normal test process
locally
do some editing locally on a (loco)branch and test locally then add. and commit locally
(loco)$git add . (loco)$git commit -m "my local edits"
push that branch to github
(loco)$git push origin loco
server
try the local changes by fetching origin then fast-forward the server branch by
(loco)$git fetch origin (loco)$git merge origin/loco