tags:

views:

229

answers:

2

I am looking for some advise with git and push/pull and trying to get my head around the correct flow.

I have a Master branch hosted on codebasehg.

So locally I am working and commiting and pushing.

From the staging and production servers I just want to pull as I will never be working from these machines. Does this mean when I do a pull it is going to ask me to merge conflicts? As really all I am looking to do from the servers are to collect the master.

The second question is the site im working on is just about finished for stage 1. Once at this stage I will then want to create a branch. Then with the branch I want to test on staging server before merging and going to production. I hope this is right? So when creating the branch will it go to codebasehg when I do a push from me dev? If so will I then just checkout the branch on the staging server? Once finshed and merged locally after pushing and pulling from staging server will the branch on the staging server be merged as well?

I hope this makes sense and thank you of you can advise.

+1  A: 
  1. if there are no changes made to local repository on your server, there would be no conflicts

  2. you have to push the local branch to repository, the you checkout the latest changes on the server

arjan
+2  A: 

Does this mean when I do a pull it is going to ask me to merge conflicts?

What conflicts? When all you do in a repository is pull and you never edit anything, how could you possibly get any conflicts?

So when creating the branch will it go to codebasehg when I do a push from me dev?

Of course, if you use the correct syntax:

# create a new branch locally
git branch name_of_branch
git checkout name_of_branch
# edit/add/remove files    
# ... 
# Commit your changes locally
git add fileName
git commit -m Message
# push changes and new branch to remote repository:
git push origin name_of_branch:name_of_branch
innaM