Gitflow: git init flow diz que a árvore de trabalho contém alterações não preparadas, mas não é verdade

Criado em 18 out. 2017  ·  14Comentários  ·  Fonte: nvie/gitflow

Oi,

Não consigo git init flow em um repositório existente, o que posso fazer para corrigir isso?

Não há mudanças não encenadas, é mentira, eu já fiz isso:

% git flow init
Fatal: Working tree contains unstaged changes. Aborting.
% git reset --hard
HEAD is now at 5e30792 
% gs
On branch feature-xyz
Your branch is ahead of 'origin/feature-xyz' by 1 commit.
  (use "git push" to publish your local commits)
nothing to commit, working directory clean
% git flow init
Fatal: Working tree contains unstaged changes. Aborting.

Comentários muito úteis

Eu tenho o mesmo problema e tentei abaixo do comando que funcionou para mim

git reset --hard

Consulte: https://stackoverflow.com/questions/28251527/initializing-git-flow-in-existing-repository

Todos 14 comentários

experimentar :
git commit -m "TAG"
git push --all
git flow init -d

Thx, mas infelizmente ainda os mesmos resultados:

% git flow init -d
Fatal: Working tree contains unstaged changes. Aborting.

Mesmo com força:

% git flow init -f -d
Fatal: Working tree contains unstaged changes. Aborting.

cheque nº 81

thx, eu já tentei a sugestão em # 81 antes, e apenas tentei novamente, ainda sem sorte.

% git reset --hard origin/master
HEAD is now at 5e30792 
% git flow init -f
Fatal: Working tree contains unstaged changes. Aborting.
% gs
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
% git status
git add .
git status
git commit -m 'Commit typechanges'
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
% git flow init -f
Fatal: Working tree contains unstaged changes. Aborting.

Finalmente consegui fazer funcionar, criando um novo dir, repo e depois puxando o git remoto. Talvez o problema seja que eu também esteja usando o git-crypt?

Por exemplo

mkdir project-with-flow
cd project-with-flow
git init
git flow init
git remote add origin example.com/project.git
git pull
# do this for every branch
git branch --set-upstream-to=origin/master master 

Legal, agora está tudo bem?

Sim, agora tudo parece funcionar. Eu só tive mais uma vez, com um comando git flow feature , mas não lembro qual. Talvez publish . Acabei de fazer git push -u --all então.

Fecha esta questão :D

Ah caramba, acabei de pegar de novo, com git flow feature finish , agora suspeito que tenha algo a ver com o uso de git crypt . vou fechar esse assunto

Eu tenho o mesmo problema. Estou apenas tentando fazer tarefas muito simples e cotidianas, então adicionei git e git-flow e agora não consigo usar nada.

Eu tenho o mesmo problema e tentei abaixo do comando que funcionou para mim

git reset --hard

Consulte: https://stackoverflow.com/questions/28251527/initializing-git-flow-in-existing-repository

Estou um pouco atrasado, mas o que costumo fazer é algo como:
git stash && git flow <command> && git stash pop

Espero que isso ajude alguém no futuro :)

Obrigado @gongAll , funcionou perfeitamente! Muito mais fácil do que redefinir e recriar as alterações. Para explicar, esses comandos funcionaram para mim, depois de obter Fatal: Working tree contains unstaged changes. Aborting. :

git stash
git flow init
git flow feature start my-new-flow-feature-branch 
git stash pop
Esta página foi útil?
0 / 5 - 0 avaliações

Questões relacionadas

primeminister picture primeminister  ·  4Comentários

alexjeffburke picture alexjeffburke  ·  24Comentários

keithamus picture keithamus  ·  32Comentários

nvie picture nvie  ·  11Comentários

tianon picture tianon  ·  60Comentários