My question is not a technical one, but more like advisory from a more experienced GIT user.
So, our team has 2 directories in the server, one is for staging where we test the changes we make, and the other one is the public directory where we can find the files for the live website. Until now, we were using FTP to update the files on the public directory, but now we switched to GIT so that we can track our changes.
I set up the GIT environment with a hook so that when we push some changes from the staging repository localy, they are automatically deployed to the staging directory on the server. Now I want to make the same to the public directory but some files (maybe I will also have a problem with the Work Tree?) between Staging and Public are different and I also don't want to lose the commits already made in the local staging repository.
What do you think is the best and most efficient way to do this transission?
My idea of the procedure is this:
- Clone the public project hosted on the server,
- Fetch or merge my local repository to the cloned respository from the server(public)
- Now I have a single repo from where I can push my changes to server and force push(at the beginning) to the staging.
Does this sound ok to you?