Merging two git repositories together with Django web server, one developer -
i started django project locally , have been using git fine.
i got ahead of myself , copied code server instantly became out of sync local version. hadn't done branch or anything.
the 2 part question what's best structure me work locally, push/pull test server , update live server when test solid, , how setup i'm at?
i've been developing no branches in these stages, i'd instead follow standard practices branching , merging.
i'm using netbeans 6.8 locally coding , i've got gitx. integration tips helpful i'm comfortable doing whatever command lines necessary.
thanks!
james
first should able have form of communication between git repositories you've got on local machine, test server , live server. git flexible in regard few of options are:
- have test , live server pull local repository.
- from development push test , live servers on appropriate times.
- from development push production , have test server pull production.
- have fourth location you'll store git repo , push development repository , have test , live pull there.
either way, once reach stage you'll want try on test server, create tag. on test server checkout tag (git checkout <tagname>
) , testing. (and once satisfied works way want, can use tag on production. guess that's pretty obvious. :) )
the intermediate step, between creating tag , checking out, depends on setup. using fourth option mentioned you'll need push tag first , fetch on testing machine. whole process similar this.
<development>$ git tag v1.0 <development>$ git push <development>$ git push --tags <testing>$ git fetch --tags <testing>$ git checkout v1.0 <live>$ git fetch --tags <live>$ git checkout v1.0
optionally can (ab)use git decribe
check tag you've got checked out @ currently.
regarding branching , merging: create branch every feature i'm working on. once complete feature merge master. if need release before feature done, can leave feature (and every releated) commit out of release.
but 1 way of doing it. can setup workflow suit your situation. regarding use of branches. more complex setup described vincent driessen in article a successful git branching model.
disclaimer: i'm using git exclusively 1 authoritative repo on server (the fourth option). haven't tried other setups suggested...
update respond comment ijames:
to make dev push , test pull new/different repository default on, see accepted answer of this question:
$ git branch --set-upstream master origin/master
with regards terminology:
- push relatively simple: pushes local commits different repository. see instance git user's manual.
- fetching opposite, "will update of remote-tracking branches latest version found in repository". (quote git user's manual.)
- the pull command not fetches changes in, merges them current branch. (see the example in official git tutorial.)
Comments
Post a Comment