Solucionado (ver solução)
Solucionado
(ver solução)
7
respostas

fatal: not a git repository (or any of the parent directories): .git

fatal: not a git repository (or any of the parent directories): .git

Aparece esta mensagem sempre q tento dar PULL no diretório da "ana"

Usuário@DESKTOP-67H5F9G MINGW64 /c/Git (master) $ ls ana/ ide-config.txt INDEX.html.txt

Usuário@DESKTOP-67H5F9G MINGW64 /c/Git (master) $ git --help usage: git [--version] [--help] [-C ] [-c =] [--exec-path[=]] [--html-path] [--man-path] [--info-path] [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare] [--git-dir=] [--work-tree=] [--namespace=] []

These are common Git commands used in various situations:

start a working area (see also: git help tutorial) clone Clone a repository into a new directory init Create an empty Git repository or reinitialize an existing one

work on the current change (see also: git help everyday) add Add file contents to the index mv Move or rename a file, a directory, or a symlink restore Restore working tree files rm Remove files from the working tree and from the index sparse-checkout Initialize and modify the sparse-checkout

examine the history and state (see also: git help revisions) bisect Use binary search to find the commit that introduced a bug diff Show changes between commits, commit and working tree, etc grep Print lines matching a pattern log Show commit logs show Show various types of objects status Show the working tree status

grow, mark and tweak your common history branch List, create, or delete branches commit Record changes to the repository merge Join two or more development histories together rebase Reapply commits on top of another base tip reset Reset current HEAD to the specified state switch Switch branches tag Create, list, delete or verify a tag object signed with GPG

collaborate (see also: git help workflows) fetch Download objects and refs from another repository pull Fetch from and integrate with another repository or a local branch push Update remote refs along with associated objects

'git help -a' and 'git help -g' list available subcommands and some concept guides. See 'git help ' or 'git help ' to read about a specific subcommand or concept. See 'git help git' for an overview of the system.

Usuário@DESKTOP-67H5F9G MINGW64 /c/Git (master) $ git remote local

Usuário@DESKTOP-67H5F9G MINGW64 /c/Git (master) $ git push local master Enumerating objects: 10, done. Counting objects: 100% (10/10), done. Delta compression using up to 4 threads Compressing objects: 100% (6/6), done. Writing objects: 100% (10/10), 1016 bytes | 508.00 KiB/s, done. Total 10 (delta 1), reused 0 (delta 0), pack-reused 0 To C:/servidor/

  • [new branch] master -> master

Usuário@DESKTOP-67H5F9G MINGW64 /c/Git (master) $ cd ..

Usuário@DESKTOP-67H5F9G MINGW64 /c $ cd ana

Usuário@DESKTOP-67H5F9G MINGW64 /c/ana $ ls servidor/

Usuário@DESKTOP-67H5F9G MINGW64 /c/ana $ git pull local master fatal: not a git repository (or any of the parent directories): .git

Usuário@DESKTOP-67H5F9G MINGW64 /c/ana $ git remote fatal: not a git repository (or any of the parent directories): .git

Usuário@DESKTOP-67H5F9G MINGW64 /c/ana $ git remote fatal: not a git repository (or any of the parent directories): .git

Usuário@DESKTOP-67H5F9G MINGW64 /c/ana $ git remote rename origin local fatal: not a git repository (or any of the parent directories): .git

Usuário@DESKTOP-67H5F9G MINGW64 /c/ana $ git rm servidor/ fatal: not a git repository (or any of the parent directories): .git

Usuário@DESKTOP-67H5F9G MINGW64 /c/ana $ git rm servidor fatal: not a git repository (or any of the parent directories): .git

Usuário@DESKTOP-67H5F9G MINGW64 /c/ana $ ^C

Usuário@DESKTOP-67H5F9G MINGW64 /c/ana $

7 respostas

Olá João Victor, tudo bem? Pelo que eu entendi você está na pasta Ana e quer fazer um PULL (ou seja trazer os arquivos) da pasta Servidor correto? Bem o Git está indicando no erro git remote fatal: not a git repository (or any of the parent directories): .git que a pasta Servidor não é um repositório Git, então você inicializou o a pasta Servidor usando comando:

git init --bare

Pode ser isso, tenta iniciar novamente e fala pra gente se funcionou!

Usuário@DESKTOP-67H5F9G MINGW64 /c/ana (master) $ git pull local master fatal: 'local' 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.

Olha eu olhei aki e tenho 3 "Pastas" dentro do Git bash "Servidor" onde tem isso (config description HEAD hooks/ info/ objects/ refs/) "Ana" onde tem isso (config description HEAD hooks/ info/ objects/ refs/ servidor/) "Git" onde tem isso (ana/ description hooks/ INDEX.html.txt objects/ config HEAD ide-config.txt info/ refs/) No git tbm se encontra o remote "local" e somente la ele se encontra.

O remoto master é da pasta "Servidor"? Bem se for, ele ainda insiste em informar que essa pasta "Servidor" não é um repositório Git, talvez não seja um repositório de armazenamento, então você pode tentar apagar essa pasta "Servidor" e criar novamente e logo em seguida executar dentro da pasta o comando:

git init --bare

E fala pra gente se funcionou!

$ rm servidor rm: cannot remove 'servidor': Is a directory

tem um arquivo ''servidor" dentro da pasta "ana" e outro no disco local C:

Encontrei o erro, depois de resetar a branch e começar as aulas desde o começo cheguei na aula onde ensina a ignorar um arquivo com .gitignore. e no video me parece q quando vc da esse nome a um arquivo ele vira um arquivo especifico do GIT mas o meu arquivo sempre vira um arquivo txt comum isso pode estar atrapalhando alguma ideia do q eu posso fazer?

solução!

Eu finalmente consegui dps de dar uma lida e uma pesquisada vi q o problema estava no jeito q eu criava o arquivo .gitignore pelo q parece alguns editores de texto adicionam uma extensão TXT no final do arquivo assim fznd com que ele não funcione então ou use outro editor de texto q não adicione a extensão Ou use o seguinte comando no bash touch .gitignore para o Git criar para você.

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software