error allow git local

Asked

Viewed 3,231 times

1

I’m having trouble already caught on the 2nd day. I can’t commit files on my system.

Error found while posting to 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 specific path: git remote add <name> <url>

I used:

git push origin master

I tried to use that tag:

git config receive.denyCurrentBranch ignore

Didn’t work.

I uninstalled. Reinstalling had a reference to SSL. I thought this was because searching saw in some responses talking about it.

But it wasn’t. Does anyone know how I solve this local problem on my machine.

  • Common bug you’re starting with. Make sure you’ve used git init and add the remote repository git remote add origin https://github.com/seu-usuario/repo

  • but is local D: Tec Dev GIT_REPORTORIOS or C: Users Documents project I did not enter this tag. Due to this error?

1 answer

3

Try it this way:

git init - To start the local repository;

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

git push nome-repositorio nome-branch - This will cause you to send a branch(name-branch) 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 Repositories(Bare)

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 writing access from 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.

Anyway, there are basically four options:

  • Local mapping
  • SSH
  • Git’s own protocol
  • HTTP

What you’ll choose (or whether you’ll choose a hybrid solution like 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 repositories that go on the developers' machines that would be the development repositories, created with the command git init (without the --bare).

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

What’s more, Bare repositories don’t have Working directory, making it impossible to edit and commit files in that repository.

But for your case:

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 run inside the External HD

git init --bare

creating local repository and uploading to remote

git init

make the initial commit "-a" will add all the files in the commit and "-m" allows you to add a comment to the commit.

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

recording the external hard drive address so you don’t have to keep typing forever

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

updating the external hard drive

git push hdexterno

to clone an external hard drive project on your machine

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

taking news from external hard drive and updating on the machine

git pull hdexterno
  • I used the remote add didn’t work out C: Users Documents git project remote add origin D: Tec Dev GIT_REPORTORIOS fatal: remote origin already exists. I added a file in my clone folder to commit and when I pushed the error was: remote: To squelch this message and still Keep the default behaviour, set remote: 'receive.denyCurrentBranch' Configuration variable to refuse 'refuse'. To D: Tec Dev GIT_REPORTORIOS ! [remote Rejected] master -> master (branch is Currently checked out) error: failed to push some refs to ' D: Tec Dev GIT_REPORTORIOS' C: Users Documents project\

  • Dude, I made an edit on my answer, I hope it helps!

  • thank you, I’ll give you a review of the situation C: Users Documents project x> git init Initialized Empty Git Repository in C:/Users//Documents/project/x/. git/ PS C: Users Documents project x> git status On branch master No commits yet Untracked files: (use "git add <file>..." to include in what will be Committed) (text.txt) Nothing Auntracked to commit but commit untracked files present (use "git add" to track) PS C: Users Documents project x> git add * PS C: Users Documents project x> git commit -m "1 commit" [master (root-commit) c2f3081] 1 commit 1 files changed, insertions(+)

  • ----------------------------------------------------------------------------- C: Users Documents project x> git status On branch master Nothing to commit, Working Tree clean PS C: Users ext.jasuris Documents project x> git log commit c2f30819194e3c8cd45136d802e6cf102b246cf3 (HEAD -> master) Author: Jr <[email protected]> Date: Thu Jul 5 11:34:41 2018 -0300 1 commit

  • Here is the big awesome problem but I can’t solve that error C: Users Documents project x> git push origin master fatal:.

  • C: Users Documents project x> git config --list core.symlinks=false core.autocrlf=true core.fscache=true color.diff=auto color.status=auto color.branch=auto color.Interactive=true help.format=html rebase.autosquash=true http.sslbackend=schannel&#xA;diff.astextplain.textconv=astextplain&#xA;filter.lfs.clean=git-lfs clean -- %f&#xA;filter.lfs.smudge=git-lfs smudge -- %f&#xA;filter.lfs.process=git-lfs filter-process&#xA;filter.lfs.required=true&#xA;credential.helper=manager&#xA;user.name=Jr [email protected]

  • gui.recentrepo=C:/Users/ext.jasuris/Documents/x/testeGIT&#xA;gui.recentrepo=C:/Users/ext.jasuris/Documents/projeto/x&#xA;core.repositoryformatversion=0&#xA;core.filemode=false&#xA;core.bare=false&#xA;core.logallrefupdates=true&#xA;core.symlinks=false&#xA;core.ignorecase=true&#xA;PS C: Users Documents project x>

  • I picked up a path from an external server that actually gave permission error :/ : - 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.

  • Has teamviewer?

  • It is by the company I will try to do the same procedure at home and put the feed here, ams not only with me other should also the same thing when will push qq brunch in my case until the site of the error:[C: Users Documents project x> git push origin master 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.]

Show 5 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.