Question

I created a Git repository on BitBucket for a project with 5 committers. All of us are new to Git and are using TortoiseGit. We just have the master branch and all we want is a simple "SVN-like" workflow: get other people's changes, make some changes yourself, let other people see your changes.

One particular committer seems to be having a lot of trouble with Git and he's overwritten other people's changes several times now. Undoing the damage is very difficult, because I don't know much about Git either. I can't watch him as he uses Git, so I don't know exactly what he does, but I'd like to tell him: here's what to do to ensure this doesn't happen. For SVN that would be: before committing, always update first, merge your changes and test that everything still works. What should I tell him for Git?

Was it helpful?

Solution

If you're going to use git, you should use the power git offers... branches!

On the assumption that you don't want to complicate the workflow any more than necessary though, simply tell your developer that before committing, always git pull --rebase. In a nutshell, this will: a) save off your local changes, b) pull remote changes (that is, changes others have committed and pushed), c) replay your local changes onto the new code base.

OTHER TIPS

Have everyone pull from a 'team' source repo and push their work to their own repos. Then have an integration manager pull from all individual repos, merge it all together, and push it on to the team repo. This will ensure no one overwrites anyone else's work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top