local git permission error

0

I'm having a problem already on the 2nd day. I can not commit files on my system.

Error encountered while publishing to the remote repository:

Git failed with a fatal error.
Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Falha ao enviar o branch por push para o repositório remoto. Consulte a 
Janela de Saída para obter mais detalhes.

fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I tried to use only push :

git push 

He asked for a specific path: git remote add <name> <url>

I used:

git push origin master

I tried to use this tag:

git config receive.denyCurrentBranch ignore

It did not work.

Uninstalled. Reinstalling had a reference to SSL. I thought that was it, because researching saw in some answers talking about it.

But it was not. Does anyone know how to solve this local problem on my machine.

    
asked by anonymous 04.07.2018 / 22:15

1 answer

2

Try this:

git init - To start the local repository;

git remote add nome-repositorio-remoto end-repositorio-remoto - To indicate the address of the remote repository;

git push nome-repositorio nome-branch - This will cause you to send a branch (branch-name) to your remote repository (origin).

Example:

$git init
$git remote add origin https://[email protected]/tonidev/bootstrap4.git
$git push origin master

EDIT 1: Local bare repositories

You may, for example, need authentication for read access or may require more server speed. For each of these choices, there is a recommended protocol. Github, for example, provides read access to public repositories via git protocol (lighter and faster). But for write access of project commiters, it uses SSH (a bit heavier, but provides authentication). Another option is HTTP for reading, which makes it easy to traverse corporate firewalls.

Finally, there are basically four options:

  • Local mapping
  • SSH
  • git's own protocol
  • HTTP

What you will choose (or whether you will opt for a hybrid solution such as Github) depends on your needs.

With the command git init --bare you are creating a repository that is pushable . Generally bare repositories are created on the server and are considered repositories for storage, in contrast to the repositories that go on the developers' machines that would be the development repositories created with the command git init (without --bare ). >

Although the GIT is a distributed versioning control system, it is very common that there is a central repository that facilitates the exchange of information between the developers, avoiding the need for the developers' computers to communicate directly with each other. >

In addition, bare repositories do not have working directory , making it impossible to edit and commit files in this repository.

But for you:

Creating Repository Structure on External HD

mkdir repositorios
cd repositorios
mkdir nome_projeto
cd nome_projeto

The command below creates a remote repository, must be rotated inside the External HD

git init --bare

Creating local repository and sending to remote

git init

Initial commit "-a" will add all the files in the commit and "-m" will allow you to add a commit comment.

git add .
git commit -a -m 'comentário'

Recording the External HD address so you do not have to always type

git remote add hdexterno /caminho-do-hdexterno/caminho-repositorio/caminho-projeto
#se precisar remover
git remote rm hdexterno

updating hdexterno

git push hdexterno

to clone an external hd project on your machine

git clone /caminho-do-hdexterno/caminho-repositorio/caminho-projeto

getting news from external hd and updating on the machine

git pull hdexterno
    
04.07.2018 / 22:20