I\'m quite new to Git (and VC for that matter) and I\'m struggling a bit to understand the concept behind the Dev>Staging>Live workflow using branches.
I\'m trying to ap
For an example of a git workflow, take a look at mine:
http://dymitruk.com/blog/2012/02/05/branch-per-feature/
This should get you started to a mature process.
You don't need to create different repositories. What you should learn and you'll probably love about git is how easy it is to work with branches. So step 1:
Now that we are all set, here is the idea. Let's say you have currently only master
on your bitbucket:
Clone the repository:
$ git clone git@bitbucket.org:user/example.com.git
$ cd example.com
Create your branches:
$ git branch dev
$ git branch staging
Let others know about these branches:
$ git push origin dev
$ git push origin staging
Start working!
$ git checkout dev
$ touch new_file
$ git add new_file
$ git commit
$ git merge master # and resolve conflicts
$ git checkout master
$ git merge dev
$ git push origin
Note: The example above is a simple branch-experiment-merge, and would probably not reflect the exact workflow as your tutorial.
So in short, you don't have different repositories, but branches in a single repository. Between these branches, you can merge as much as you want with whatever workflow you like. You can have additional branches that are not pushed to origin, so they are hidden from others. You should also of course git fetch
/git merge
the branches you want to work on every often to make sure you get the latest changes from other collaborators.