66
10
we recently switched from SVN to Git and at the same time put our live systems into version control (instead of local checkout and file copy to live).
On the project i'm assigned to we all access the same repository and to get changes into live we just git pull
there. This causes problems because our webdesigners push changes into the VCS that should not be live yet but should be on the web-testing environment.
When one of the developers now pulls into live he gets all (possibly unfinished) changes.
I thought of switching live to an extra branch and just merge what changed but due to my lack of git knowledge i have no idea how.
My idea is:
- Create a new Branch in live (
git branch live
). - Every time something has to go live
- Pull changes in master (like:
git checkout master; git pull; git checkout live
) git merge master
- Pull changes in master (like:
The problem is that switching to master or pulling everything directly into the live system would cause problems so i'd prefer to avoid this.
Is there any way to do this or is there any better way to manage the Live system (except for training the webbies to not push unfinished stuff).
1
related: http://stackoverflow.com/questions/3216360/merge-update-and-pull-git-branches-without-using-checkouts
– Ciro Santilli 新疆改造中心法轮功六四事件 – 2014-08-11T15:29:20.2431
git pull --all
will by default not pull master into live, it will pull master and merge it with master, and (if existing on the server) pull live to merge into live. Did you try it? – Tobias Kienzler – 2010-07-16T07:56:05.043Is your problem caused by a file that was not under version control before branching off live and git-added after modification to master later on? That's what happened to me before, usually it should suffice to temporarily rename that file, or if it isn't needed at live, use
git checkout -f
to ignore the problem - but make a backup! – Tobias Kienzler – 2010-07-16T10:37:40.680