=====
The following workaround may only be applicable to the situation I have encountered, but also want to do hooks, but also to restore the old people to configure the normal use of git.
=====
Because it is a former employee with the staff, so first check the original git can be used normally not:
1. Only one branch master
2, the repository and the project directory are the same, that is
git clone [email protected]:/home/project
The project directory on the production server is also:/home/project
And I don't know what they are.
3. On the production server, execute Git pull and report the following error:
Fatal:no remote repository specified. Please, specify either a URL or a
Remote name from which new revisions should is fetched. = "Baidu above the error, there are many of the same solution on the line, but may not be what I want." And I created the files locally in 1.txt and 2.txt files, git add on master. , git commit-m "xx", Git push, to the production server becomes: Use git status to view the status: Green: deleted 1.txtdeleted 2.txt = "This is not normal, I obviously submitted two new files, But the production server is prompting me to delete these two files. Faint feeling, may have relations with authority. So, I changed the permissions of the project folder to 777, and then git status doesn't happen.
4. configuration file. git/config
[Core]
repositoryformatversion = 0
FileMode = True
Bare = False
Logallrefupdates = True
Quotepath = False
[Receive]
Denycurrentbranch = Ignore
==========================================
Solution:
1, to the project folder to improve permissions
Chmod-r 777/home/project
2. Modify the. git/config file
[Core]
repositoryformatversion = 0
FileMode = True
Bare = False
Logallrefupdates = True
[Receive]
Denycurrentbranch = Ignore
Denynonfastforwards = False
3, enter. git/hooks/
= "Git hooks, Baidu has a lot, but may not apply to my side of the situation."
Put a file, file name: post-update
#!/bin/sh
#
# An example hooks script to prepare a packed repository
# dumb transports.
#
# To enable the This hook, the rename this file to "Post-update".
Cd..
Env-i git reset--hard
=======================
Results:
I submitted locally, the file directory in the project folder on the production server also changed and the hooks were successful.
Git service-side problem resolution FATAL:NO remote repository specified. Please, specify either a URL or a remote name from which new revisions should be fetched.