I have git on my local computer where I am developing. I can commit changes ..etc. and push those commits to bitbucket.
But confused how am I supposed to then push these changes to my production server? I tried init --bare on my servers local directory and pulling the repo but git didnt like it.
Ideally, I just want to push commits to Bitbucket from local computer and then push changes to production server.
What is the standard practice?
I think that's what you want:
Develop locally and 1.) commit to your local repsoitory - 2.) push your local repository to your Bitbucket server - and 3.) have those pushes available on your production server
In this case Bitbucket Server holds your CENTRAL repository - every developer should push his changes to this server. Everone who needs the CENTRAL repository (even your production server) should pull it from Bitbucket server.
For your production server you can either
1.) pull the repository manually
2.) set up an automated "Pull": Each time you do a push to your central repository, your production machine is notified and pulls the repository on notification. Bitbucket Server offers serval plugins to support the notification process - the one I use is Http Request Post Receive Hook: each time a push is made, a configured URL is contacted, submitting some info. On my production machine I have set up a little web server, waiting for this HTTP-Request. On receiving the HTPP-Request I evaluate the given parameters and perform an action (for example: pulling the repository ...)
Summary: Your production machine has to be notified about "pushes" to central repository (by using a post-receive-hook within Bitbucket Server) - after getting the notification, your production server has to react correspondingly (for example by pulling the repository).
Nice! Thanks for sharing workflow. I'm not sure if I can setup the auto push alert to production server on my Media Server DV host. It's using the Plesk Panel and has a component install that can help set up a git connection.
The database sync confusing / stresses me out. May try it with a hello world wp install.
Bitbucket is the central point here, that's where your code lives. You clone your repo from Bitbucket to your workstation, make the changes and push the changes back to Bitbucket. Once you have code that you think is ready for primetime you'd clone the repo onto your production server (or pull changes if you've cloned the repository already).
Premier Support Engineer
I am talking about committing locally and then a push to origin at Bitbucket repository.
Want I want to do is once I am happy with changes locally I want to push all the changes to my staging environment on a server.
I thought I could just pull the updated Bitbucket repository from my staging server but doesnt work.
Thanks for all the answers. So if I need to do a pull from my production server (I prefer manual) then the following should have worked:. Git init --bare then git add remote origin (link to bitbucket repository) then git pull --all. But this doesn't work? Error not branch found
You shouldn't use git init --bare since option bare is a "special" option for repository servers (see for example: http://www.saintsjd.com/2011/01/what-is-a-bare-git-repository/) - and you don't want to be your production machine to be a repository server (Bitbucket server uses bare repositories - as this is a repository server)
You cannot checkout from a bare repository - you are only able to clone it. (as far as I understood git)
So: just omitt the option --bare and try it again ...
I went with the following solution. Please any comments on this appreciated:
As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs