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.

Source: Internet
Author: User
Tags git hooks

=====

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.