Git error Summary

Source: Internet
Author: User

In order to build gitosis, I had to go through two days and encountered numerous problems. The depressing ones and the answers on the network were scattered, so I brought them together, and put up your own solutions and ideas, there may be mistakes and omissions.

1. untracked working tree file 'external/Broadcom/Android. mk 'wocould be overwritten by merge. Aborting

You must run the following command to fix the problem:

     git reset --hard HEAD      git clean -f -d      git pull  

2. Please, commit your changes or stash them before you can merge.

If you want to retain the changes made on the production server and only incorporate the new configuration items, the solution is as follows:

git stashgit pullgit stash pop

Then, you can use git diff-W + file name to confirm the Automatic Code merging.

If you want to use the files in the code library to completely overwrite the local working version, the method is as follows:

git reset --hardgit pull

Git reset is for version. If you want to roll back local modifications to the file, use

git checkout HEAD file/to/restore  

3. does not appear to be a git Repository

Path error. You can try absolute or relative paths respectively.

This also happens if the pure repository of another server is obtained to the server. My temporary practice is to clone the content of another server to the local server, and then create a pure repository on the local server and put it in the repository path. For this error, I will try to find the cause in this article:

Http://blog.csdn.net/xzongyuan/article/details/9366873

4. Error: gitosis. Serve. Main: Repository read access denied

After you modify the gitosis-conf of the local gitosis-admin (as shown below) and push it to the repository, you will also encounter this problem.

[Group customer]
Members = nexus B
Readonly = box_4.2

Cause 1: gitosis. conf is written incorrectly:
Members in gitosis. conf is inconsistent with the username in keydir. For example, members = Foo @ bar in gitosis, but the public secret name in keydir is foo. Pub.
Solution
Make the keydir name consistent with the name specified by members in gitosis.

Change members = Foo or password name to foo@bar.pub

Reference
Http://blog.csdn.net/lixinso/article/details/6526643

Note: if such an error occurs in the middle, it is likely that the gitosis. conf configuration is incorrect.
Error: gitosis. Serve. Main: Repository read access denied
Fatal: the remote end hung up unexpectedly

It may be:
1. the username written in gitosis does not exactly match the key name in the keydir.
2. Some errors have been written. For example, I wrote members as member and Khan.

Cause 2 address error:

Even if the address is incorrect, did not apear to be a git repositry is displayed. But I also encountered this error. If the relative path is wrong, the system will prompt that you do not have the permission, because gitosis. conf does not have the configuration of this file. View my records:

For the first time, I did not know the relative path of the error:

Norton @ Norton-LAPTOP :~ /Work $ git clone git@192.168.0.3:/repositories/gitosis-admin.git
Initialized empty git repository in/home/Norton/work/gitosis-admin/. Git/
Error: gitosis. Serve. Main: Repository read access denied
Fatal: the remote end hung up unexpectedly

The second time, deliberately write a nonexistent path

Norton @ Norton-LAPTOP :~ /Work $ git clone git@192.168.0.3:/repositories/gitosis-admin.git2
Initialized empty git repository in/home/Norton/work/gitosis-admin.git2/. Git/
Error: gitosis. Serve. Main: Repository read access denied
Fatal: the remote end hung up unexpectedly

For the third time, write to the relative path. The root directory of the relative path is/home/git/repositories. Remember not to write unnecessary paths. Note: repositories is manually created before gitosis initialization. It is a soft link that links to/home/repo. If this step is not done, a repositories folder will be created during initialization, so the gitosis-Admin repository will be in this real folder instead of being put in/home/repo through soft connections.

Norton @ Norton-LAPTOP :~ /Work $ git clone git@192.168.0.3: gitosis-admin.git

Initialized empty git repository in/home/Norton/work/gitosis-admin/. Git/
Remote: counting objects: 5, done.
Remote: compressing objects: 100% (5/5), done.
Remote: Total 5 (delta 0), reused 5 (delta 0)
Grouping objects: 100% (5/5), done.

Cause 3: Open the wrong account

Sometimes, if you do not have a clear mind, you will get the wrong account. Therefore, you need to think about whether the wrong account has been made. In the main account admin, constantly test the download, my goal is to test the download with B's account. As shown in the following configuration (Admin is not authorized to read teamwork, but I have been clone teamwork)

[Gitosis]

[Group gitosis-admin]
Members = Admin
Writable = gitosis-Admin Test

[Group rk_download]
Members = B nexus
Readonly = teamwork box_4.2

~
~

Test Results

Admin @ admin :~ /Work/test $ git clone git@192.168.0.3: Test. Git
Initialized empty git repository in/home/admin/work/test/. Git/
Remote: counting objects: 3, done.
Remote: Total 3 (delta 0), reused 0 (delta 0)
Grouping objects: 100% (3/3), done.

Admin @ admin :~ /Work/test $ git clone git@192.168.0.3: Teamwork. Git
Initialized empty git repository in/home/admin/work/test/teamwork/. Git/
Error: gitosis. Serve. Main: Repository read access denied
Fatal: the remote end hung up unexpectedly

Admin @ admin :~ /Work/test $ git clone git@192.168.0.3: Teamwork. Git
Initialized empty git repository in/home/admin/work/test/teamwork/. Git/
Error: gitosis. Serve. Main: Repository read access denied
Fatal: the remote end hung up unexpectedly

Admin @ admin :~ /Work/test $ git clone git@192.168.0.3: Teamwork. Git
Initialized empty git repository in/home/admin/work/test/teamwork/. Git/
Error: gitosis. Serve. Main: Repository read access denied
Fatal: the remote end hung up unexpectedly

After the record was completed, I was dumb again. I cloned n times of test, but I couldn't. I found that I didn't set the test permission for B. Again, we need to be clear-headed.

$ Git clone git@192.168.0.3: Test. Git
Initialized empty git repository in/tmp/test/. Git/
Error: gitosis. Serve. Main: Repository read access denied
Fatal: the remote end hung up unexpectedly

After modification
Initialized empty git repository in/tmp/teamwork/test/. Git/
Remote: counting objects: 3, done.
Remote: Total 3 (delta 0), reused 0 (delta 0)
Grouping objects: 100% (3/3), done.

Cause 4: the absolute path cannot be written.

I don't know why for the moment. If git @ <Server IP>:/home/repo/xxx. Git is written in the path, this error will occur. It seems that if you fail to verify the key and require you to enter the password, the absolute path is entered. If the key is verified successfully, the absolute path is entered and it is not recognized. I think this is to ensure system security and prevent the client from using the GIT account to clone files not under repositories, that is, the files are limited to repositories, so they can only use relative paths.

5. Ssh: the authenticity of host 0
Down vote

This message is just SSH telling you that it's never seen this participant ular host key before, so it isn' t able to truly verify that you're ing to the host you think you are. when you say "yes" it puts the SSH key into your known_hosts file, and then
On subsequent connections will compare the key it gets from the host to the one in the known_hosts file.

There was a related article on Stack Overflow showing how to disable this warning, http://stackoverflow.com/questions/3663895/ssh-the-authenticity-of-host-hostname-cant-be-established.

6. unrecognized command 'gitosis-serve B '& Password required for each login

$ Git clone git@192.168.0.3:/home/repo/teamwork. Git
Initialized empty git repository in/home/B/work/teamwork/. Git/
Fatal: Unrecognized command 'gitosis-serve B'
Fatal: the remote end hung up unexpectedly

In this case, B is an ordinary account of mine, and the other admin requires a password for every login (SSH has two login Methods: requires a password, and do not need to enter the password-use the key), I suspect that the gitosis configuration has messed up for me, so the correct key cannot be identified.
At this time, I have modified the key pair many times and gitosis has been configured many times. Gitosis-init does not fix this issue. Therefore, I deleted the repository-related folders under/home/git/, including the authoritykey under. Ssh. The gitosis-admin.git under/home/repo is also deleted. In this way, you can repeat gitosis-init.

If git uses/usr/bin/Git-shell instead of/bin/sh in the GIT account settings in/etc/passwd on the server, this error is also reported.

7. Agent admitted failure to sign using the key.

When switching to user B through the graphic interface, this problem occurs. In the original interface, Su B can be cloned.

Use the ssh-add command to add the private key (Change id_rsa according to the name of the private key)
# Ssh-add ~ /. Ssh/id_rsa

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.