git: need to build on one branch and merge that branch to another branch -


our builds take long time. unit tests 4 hours. trying build , run unit tests on master. @ same time need merge master branch a.

is there way not change files on file system , merge branch

---------\-----master           \----a 

something "git merge from_branch to_branch" or "git merge to_branch from_branch" have observered posts alais "git checkout a; git merge master" not want do. can't checkout because have processes needing access files in master

thanks

our builds take long time. unit tests 4 hours. trying build , run unit tests on master. @ same time need merge master branch a.

there's few practices eliminate problem. first not work on master, exclusively on feature branches. master should used starting new feature branches , integrating tested feature branches. practice solves lot of problems.

- b - c - d [master]            \             e - f - g [feature] 

use git merge master keep feature branch date changes in master (alternatively git rebase master avoid lots of unnecessary merge points). feature branches can safely pushed without endangering other branches.

second use continuous integration server. is, have dedicated machine nothing build , run full test suite on whatever pushed central repository. has advantage of providing environment close real production environment possible (not whatever happens on development machine). travis ci example of ci service, jenkins open source installable ci server.

note can run own ci server on virtual machine on own desktop.

with in place, no longer need wait around long tests finish. can safely push feature branch , ci server runs tests. meanwhile can whatever want development copy.


if don't want , wish continue working on master , running long tests on development machine, simplest solution clone your development copy new location testing. cloning development copy, not shared remote copy, means have work , branches.

git clone /path/to/my/devel /path/to/my/tests 

run tests in /path/to/my/tests , development work in /path/to/my/devel.


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -