• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
spacekid434

How to use git in a mutli-user environment,

6 posts in this topic

Hello everyone and Merry Christmas,

 

Me and a friend have started working on some stuff together and we've decided to use git as our version control system. We keep running into issues with fast-forward errors. We're both working in one branch (master) and we often commit and push at the same time.

 

I'm wondering how we should best make use of egit on eclipse to try and avoid these issues. We're hosting on bitbucket if that helps. Should we both work in local branches then merge them before pushing or something like that?

 

There is very little information from what I can see on this (maybe I'm just wording it wrong in Google  and I would really appreciate some really in depth articles that describe it well, plus if they have a focus on egit as well that would be awesome, but it's by no means necessary.

 

Any help would be greatly appreciated. Thanks!

0

Share this post


Link to post
Share on other sites

Doing some more searching  I found this. Looks interesting and sort of describes what I'm looking at. I would still really love some good articles so if anyone has anything It would be really great.

 

Thanks.

0

Share this post


Link to post
Share on other sites

Well, yes, git is not google docs. What's happening is that initially, your two local repositories (the one on your computer and on your friend's) are synchronized, but when your friend pushes his modifications to the main repository, that repository is now out of date with yours, and when you try to push your own modifications, the push will probably fail since your repository is out of date. In this case you need to update your repository (git pull) and hope that doesn't trash your work in case your friend was working with the same files you were. Then you should be able to push (unless your friend pushed again since then, as you can see this can be frustrating).

 

A good idea is to not push as often - prefer to just commit, which only makes changes to your local repository, and only push once you've accomplished enough work and your friend can update his repository (hopefully you didn't write over what he is currently working on - good project management will prevent that). In fact, ideally since you are working on unrelated features of a modular system, people don't need to pull your modifications to keep working, unless it's a major bug that affects the entire codebase. They'll just do their own stuff, push to their respective files and the end user can then grab the most up to date repository, regardless of who's done or not. This doesn't directly apply to you, obviously, since on a two-man team the code you're working on will likely be very related, but the idea still stands - don't push unless your friend needs your code to keep working (or you are finished for the day).

 

Another approach is to push to an integration manager (as you saw on those links above) which'll optionally decide what to pull into the repository (for non-trusted collaborators) and merge everything together correctly, in case you were working on the same things. This is important in big projects with lots of random collaborators, since people don't communicate as much between one another and you can't just trust people to behave properly and not break each other's code, so you have a "gatekeeper" which prevents that.

 

The bottom line being that there is no good way to work together on the same piece of code, really. The whole point of collaboration is to get work done faster, and you can't achieve that by having people fight over the same lines of code. It's like asking nine woman to have a baby in a month, it doesn't work that way. So perhaps for a two-man team you could try to divide your work by having your game logic (is it a game you're making?) flexible, accepting well-defined interfaces to whatever modules you are going to use, and then have him work on the character system while you get the graphics up and running, etc.. does that make sense?

Edited by Bacterius
0

Share this post


Link to post
Share on other sites

Why not use three branches (master, one for you and one for your friend)? That way, you can both push the code. When made sure that your code in your branch does work, you can merge your branch to master. After that, your friend can merge master to his branch and continue working happily.

0

Share this post


Link to post
Share on other sites

I've thought of branching, but I wondered if it was the appropriate thing to have a branch per developer. I saw in the link I found that in git, you can fetch then merge, then push which means you won't get a non-fast-forward error.

0

Share this post


Link to post
Share on other sites
<blockquote class="ipsBlockquote" data-author="TheCreeperLawyer" data-cid="5014370"><p>I've thought of branching, but I wondered if it was the appropriate thing to have a branch per developer. I saw in the link I found that in git, you can fetch then merge, then push which means you won't get a non-fast-forward error.</p></blockquote><br />Thats pretty much what we do, commit -&gt; pull -&gt; push , git merges changes automatically even if they are made to the same file. Branches are only made to separate development of new features from maintaining the stable release.
1

Share this post


Link to post
Share on other sites

You should probably understand there is no such concept of a "master" branch in git.  You might have a local repo with one or more branches, your friend might have a local repo with one or more brances, there might be a repo at bitbucket with one or more branches.  You'll probably designate one of the branches at bitbucket as the one from which releases are made.  You probably work with one of your local branches.  there is nothing special about any of those branches except how you have decided to use them.

 

In my experience, the best practice with git is to have a local copy of the designated release branch locally, and have that one labeled 'master' (which is the default label for a newly created branch in a repo and easily created from the remote release branch using 'git clone').  Do your work on a separate local branch called 'develop', and even use feature branches from that branch for individual features.  Branching is very very cheap in git, more branches are better. Before pushing your work up to the release branch, synchronize your local copy ('master') with the remote, then merge your work on to it (fixing any conflicts if necessary).  The, push that to the remote release branch.

 

I've found this to be a nice workflow for any DVCS.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0