Git pull: "commit your changes or stash them before you merge" [Resolvido]

Publicado por Fábio Berbert de Paula em 27/05/2020

[ Hits: 15.079 ]

Blog: https://fabio.automatizando.dev

 


Git pull: "commit your changes or stash them before you merge" [Resolvido]



Problema

Você está trabalhando em um repositório local, mudou alguns arquivos, mas o repositório remoto possui alterações nos mesmos arquivos.

Ao executar um "git pull" você recebe a seguinte mensagem de erro:

error: Your local changes to the following files would be overwritten by merge
.
.
.
Please commit your changes or stash them before you merge.
Aborting

Solução

Utilizar um "git stash" para gravar o estado atual do seu repositório local, revertendo os arquivos para o estado atual do repositório remoto.

Execute:

git stash push --include-untracked

E agora sim o pull irá funcionar:

git pull

Outras dicas deste autor

Vim - como executar uma linha do texto no terminal

Capturando screenshots com Shell Script

SuperTux - O

MongoDB Community Edition 4.2 no Debian 10 Buster

Checar a conexão com a Internet em Python

Leitura recomendada

Instalando Cloudstack no CentOS

Uso avançado de Gparted - Protegendo seu Linux

Comandos ARP

Instalando o htop no Oracle Linux Server 7 a partir do código fonte

Criar usuario no Linux sem senha

  

Comentários
[1] Comentário enviado por danniel-lara em 05/11/2020 - 10:58h


Bah , meu ajudou muito hoje aqui no trabalho
Valeu



Contribuir com comentário




Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts