I am working on a website development team. Each of us has a personal website created in our home directories on the development server.
We want to convert them to git production repositories so that we can branch, reinstall, and usually take advantage of git kindness.
When reading online, there are several options:
1) create a bare repo that synchronizes with the working repo in www / through the hook after receiving.
2) click directly on the working repo
The problem with option 1 is that it cannot handle branching. When we click on a branch other than the master, the hook after reception still only synchronizes the master, so our changes never appear on the development site.
Issue with option 2 - git prohibits clicking on the extracted branch to prevent the detached HEAD state.
When reading online, the โbest practiceโ solution for option 2 looks something like this:
1) when CLIENT is pressed on a dummy branch
2) on SERVER, the fiction in master is merged ... BUZZZZ the wrong answer. Assume that end users do not have access to the server on the server.
So, I thought: โNo problem, just create an email reception like thisโ:
#!/bin/bash read oldSHA newSHA branch git merge $branch
Now here's the weird part: when the post-hook is executed, I get
Please, commit your changes or stash them before you can merge.
Yes, I confirmed that the wizard is a marked branch on the server, and that the dummy branch has been updated correctly. When I run the same command (git merge dummy) directly on the server, everything works fine.
Can someone explain why?
Thanks in advance.
EDIT 1
Below are the git state results of both pre-merge and post-merge
Counting objects: 5, done. Delta compression using up to 8 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 307 bytes, done. Total 3 (delta 2), reused 0 (delta 0) remote: **** PRE MERGE **** remote:
Please note that I can do manual git add., Git commit -m "foo" and re-execute this process with the same result