I'm trying to synchronize a branch from Bitbucket to the same branch on the remote server machine. And to do this ignoring some files and directories.
Now I try to explain me better. What I have done until now is to push the stable versions of my nodejs-app, from my local machine to Bitbucket. This works fine. Now I have the same branches as in local, and each one is a version of the app. I already pushed the files adding the file .gitingore
at the root. So in Bitbucket there are the versions for every brunches.
What I would like to do is synchronize the file no the remote server from Bitbucket.
So the first time, when on the remote server there was nothing, I used the command clone
git clone git@bitbucket.org:<my_username>/<my_repo>.git -b <my_bitbucket_branch> path/to/server/dir
After have done this, I updated from local to Bitbucket some files in a new branch called my_bitbucket_branch
.
The question is: what's the procedure to update/synchronize (and overwrite) the a specific my_server_branch
with another specific my_bitbucket_branch
, ignoring some dir/files?
At the end I would like to switch versions of the (online/remote) nodejs-app simply switch branch, like this
git checkout v01
git checkout v02
...
I'm new to Git, hope it's clear.
ADD
I need something which update+override the branch not on the Bitbucket, not on my local-pc, but on my remote server (where there is the website in nodejs). I saw the "pull" command... maybe that?
If I had on Bitbucket a branch called "v02" and on the remote server a branch called "v01", I want to override v01 with v02. So all the file in v01(on remote server) will be exactly equals in v02(on Bitbucket).