2017-03-28 2 views
0

J'ai des fichiers en conflit qui n'ont pas été résolus depuis un moment. J'ai essayé d'utiliser la commande suivante:extraire tous les fichiers en conflit dans une autre branche via bash dans git

git checkout MOODLE_31_STABLE $(grep -rwl "<<<<<<< HEAD") 

qui tente de vérifier chaque fichier et conflictuel remplacé par une copie MOODLE_31_STABLE.

malheureusement, pour certains fichiers je reçois cette erreur:

error: pathspec 'theme/boost/config.php' did not match any file(s) known to git. 
error: pathspec 'theme/boost/lang/en/theme_boost.php' did not match any file(s) known to git. 
error: pathspec 'theme/boost/readme_moodle.txt' did not match any file(s) known to git. 
error: pathspec 'theme/boost/scss/bootstrap/bootstrap.scss' did not match any file(s) known to git. 
error: pathspec 'theme/boost/scss/bootstrap/mixins/_forms.scss' did not match any file(s) known to git. 
error: pathspec 'theme/boost/scss/bootstrap/mixins/_grid-framework.scss' did not match any file(s) known to git. 
error: pathspec 'theme/boost/scss/bootstrap/mixins/_grid.scss' did not match any file(s) known to git. 
error: pathspec 'theme/boost/scss/bootstrap/mixins/_text-emphasis.scss' did not match any file(s) known to git. 
error: pathspec 'theme/boost/scss/bootstrap/utilities/_background.scss' did not match any file(s) known to git. 
error: pathspec 'theme/boost/scss/bootstrap/utilities/_visibility.scss' did not match any file(s) known to git. 
error: pathspec 'theme/boost/scss/bootstrap/_alert.scss' did not match any file(s) known to git. 
error: pathspec 'theme/boost/scss/bootstrap/_card.scss' did not match any file(s) known to git. 
error: pathspec 'theme/boost/scss/bootstrap/_input-group.scss' did not match any file(s) known to git. 
error: pathspec 'theme/boost/scss/bootstrap/_media.scss' did not match any file(s) known to git. 
error: pathspec 'theme/boost/scss/bootstrap/_navbar.scss' did not match any file(s) known to git. 
error: pathspec 'theme/boost/scss/bootstrap/_print.scss' did not match any file(s) known to git. 
error: pathspec 'theme/boost/scss/bootstrap/_progress.scss' did not match any file(s) known to git. 
error: pathspec 'theme/boost/scss/bootstrap/_reboot.scss' did not match any file(s) known to git. 
error: pathspec 'theme/boost/scss/bootstrap/_tables.scss' did not match any file(s) known to git. 
error: pathspec 'theme/boost/scss/bootstrap/_variables.scss' did not match any file(s) known to git. 
error: pathspec 'theme/boost/scss/moodle/course.scss' did not match any file(s) known to git. 
error: pathspec 'theme/boost/scss/preset-default.scss' did not match any file(s) known to git. 
error: pathspec 'theme/boost/settings.php' did not match any file(s) known to git. 
error: pathspec 'theme/boost/templates/core/dataformat_selector.mustache' did not match any file(s) known to git. 
error: pathspec 'theme/boost/templates/mod_assign/grading_navigation.mustache' did not match any file(s) known to git. 
error: pathspec 'theme/boost/thirdpartylibs.xml' did not match any file(s) known to git. 

J'ai vérifié et la branche a été vérifié, il est donc en local. les fichiers existent dans les deux branches ... Donc, je ne comprends vraiment pas pourquoi j'ai les erreurs.

+0

Plutôt que de résoudre les erreurs, pourquoi voulez-vous extraire un fichier en conflit? –

+0

l'erreur ne sont pas liés à mes changements, pour faire une histoire courte j'ai eu un projet, pas un ninja git pour le moins, et il y a des tons de conflits, maintenant, S'il y a une branche où les conflits ont été résolus correctement , pourquoi ne devrais-je pas l'utiliser? – EDU

Répondre

1

Si vous avez un fichier en conflit et vous êtes sûr que vous voulez le remplacer par une version d'une autre branche, vous pouvez utiliser cette syntaxe:

git checkout other_branch -- path/to/some/file.ext 
       ^^^ name of branch   ^^^ path of file 

Après cela, vous auriez encore à marquer le fichier comme résolu et terminer la fusion. Vous pouvez répéter ce qui précède pour tous les fichiers dont vous avez besoin. Si vous faites cela pour un grand nombre de fichiers, je dirais que votre flux de travail Git pourrait avoir une odeur, et vous pourriez vouloir reconsidérer le changer.