1
resposta

Problema com o comando git add .

Quando executo a função "git add ." gera esta mensagem enorme e não consigo dar prosseguimento aos próximos passos. Mensagem de erro: warning: in the working copy of '.vscode/extensions/ritwickdey.liveserver-5.7.9/node_modules/minimist/test/stop_early.js', LF will be replaced by CRLF the next time Git touches it warning: in the working copy of '.vscode/extensions/ritwickdey.liveserver-5.7.9/node_modules/minimist/test/unknown.js', LF will be replaced by CRLF the next time Git touches it warning: in the working copy of '.vscode/extensions/ritwickdey.liveserver-5.7.9/node_modules/minimist/test/whitespace.js', LF will be replaced by CRLF the next time Git touches it warning: in the working copy of '.vscode/extensions/ritwickdey.liveserver-5.7.9/node_modules/morgan/HISTORY.md', LF will be replaced by CRLF the next time Git touches it warning: in the working copy of '.vscode/extensions/ritwickdey.liveserver-5.7.9/node_modules/morgan/LICENSE', LF will be replaced by CRLF the next time Git touches it warning: in the working copy of '.vscode/extensions/ritwickdey.liveserver-5.7.9/node_modules/morgan/README.md', LF will be replaced by CRLF the next time Git touches it warning: in the working copy of '.vscode/extensions/ritwickdey.liveserver-5.7.9/node_modules/morgan/index.js', LF will be replaced by CRLF the next time Git touches it warning: in the working copy of '.vscode/extensions/ritwickdey.liveserver-5.7.9/node_modules/morgan/package.json', LF will be replaced by CRLF the next time Git touches it warning: in the working copy of '.vscode/extensions/ritwickdey.liveserver-5.7.9/node_modules/ms/index.js', LF will be replaced by CRLF the next time Git touches it warning: in the working copy of '.vscode/extensions/ritwickdey.liveserver-5.7.9/node_modules/ms/license.md', LF will be replaced by CRLF the next time Git touches it warning: in the working copy of '.vscode/extensions/ritwickdey.liveserver-5.7.9/node_modules/ms/package.json', LF will be replaced by CRLF the next time Git touches it warning: in the working copy of '.vscode/extensions/ritwickdey.liveserver-5.7.9/node_modules/ms/readme.md', LF will be replaced by CRLF the next time Git touches it .... continua porém ultrapassa o limite de caracteres :(

1 resposta

Olá Yago!

Parece que o Git detectou uma diferença entre os formatos de quebra de linha (LF e CRLF) nos arquivos do seu projeto. Isso pode acontecer se trabalha em diferentes sistemas operacionais, especialmente Windows e Linux. Pode tentar o seguinte.

Ignorar os arquivos desnecessários Crie (ou edite) um arquivo .gitignore na raiz do seu projeto e adicione:

.vscode/ node_modules/

Depois disso, execute: git rm -r --cached .vscode git rm -r --cached node_modules

Configurar o Git para lidar com quebras de linha automaticamente Se você está no Windows, execute este comando para que o Git converta automaticamente as quebras de linha ao puxar ou enviar arquivos:

git config --global core.autocrlf true

No Linux/macOS use:

git config --global core.autocrlf input

Agora, tente adicionar os arquivos novamente:

git add . git commit -m "Correção de arquivos e .gitignore"