Remove arquivos e palavras

0

No momento, quando executo git status , recebo

    modified:   loanwolf/alerts/locale/fr/LC_MESSAGES/django.mo
    modified:   loanwolf/alerts/locale/fr/LC_MESSAGES/django.po
    modified:   loanwolf/clientspace/locale/fr/LC_MESSAGES/django.mo
    modified:   loanwolf/clientspace/locale/fr/LC_MESSAGES/django.po
    modified:   loanwolf/configurations/locale/fr/LC_MESSAGES/django.mo
    modified:   loanwolf/configurations/locale/fr/LC_MESSAGES/django.po
    modified:   loanwolf/contracts/locale/fr/LC_MESSAGES/django.mo
    modified:   loanwolf/contracts/locale/fr/LC_MESSAGES/django.po
    modified:   loanwolf/contrib/locale/fr/LC_MESSAGES/django.mo
    modified:   loanwolf/contrib/locale/fr/LC_MESSAGES/django.po
    modified:   loanwolf/core/locale/fr/LC_MESSAGES/django.mo
    modified:   loanwolf/core/locale/fr/LC_MESSAGES/django.po
    modified:   loanwolf/core/templatetags/locale/fr/LC_MESSAGES/django.mo
    modified:   loanwolf/core/templatetags/locale/fr/LC_MESSAGES/django.po
    modified:   loanwolf/customers/locale/fr/LC_MESSAGES/django.mo
    modified:   loanwolf/customers/locale/fr/LC_MESSAGES/django.po
    modified:   loanwolf/customers/models.py
    modified:   loanwolf/dashboard/locale/fr/LC_MESSAGES/django.mo
    modified:   loanwolf/dashboard/locale/fr/LC_MESSAGES/django.po
    modified:   loanwolf/documents/locale/fr/LC_MESSAGES/django.mo
    modified:   loanwolf/documents/locale/fr/LC_MESSAGES/django.po
    modified:   loanwolf/employees/locale/fr/LC_MESSAGES/django.mo
    modified:   loanwolf/employees/locale/fr/LC_MESSAGES/django.po
    modified:   loanwolf/equifax_report/locale/fr/LC_MESSAGES/django.mo
    modified:   loanwolf/equifax_report/locale/fr/LC_MESSAGES/django.po
    modified:   loanwolf/loans/locale/fr/LC_MESSAGES/django.mo
    modified:   loanwolf/loans/locale/fr/LC_MESSAGES/django.po
    modified:   loanwolf/messaging/locale/fr/LC_MESSAGES/django.mo
    modified:   loanwolf/messaging/locale/fr/LC_MESSAGES/django.po
    modified:   loanwolf/notes/locale/fr/LC_MESSAGES/django.mo
    modified:   loanwolf/notes/locale/fr/LC_MESSAGES/django.po
    modified:   loanwolf/operations/locale/fr/LC_MESSAGES/django.mo
    modified:   loanwolf/operations/locale/fr/LC_MESSAGES/django.po
    modified:   loanwolf/perception/locale/fr/LC_MESSAGES/django.mo
    modified:   loanwolf/perception/locale/fr/LC_MESSAGES/django.po
    modified:   loanwolf/products/locale/fr/LC_MESSAGES/django.mo
    modified:   loanwolf/products/locale/fr/LC_MESSAGES/django.po
    modified:   loanwolf/requests/locale/fr/LC_MESSAGES/django.mo
    modified:   loanwolf/requests/locale/fr/LC_MESSAGES/django.po
    modified:   loanwolf/requests/models.py
    modified:   loanwolf/statistics/locale/fr/LC_MESSAGES/django.mo
    modified:   loanwolf/statistics/locale/fr/LC_MESSAGES/django.po
    modified:   loanwolf/users/locale/fr/LC_MESSAGES/django.mo
    modified:   loanwolf/users/locale/fr/LC_MESSAGES/django.po

Eu quero limpar a saída para remover modified: e os arquivos

loanwolf/requests/models.py
loanwolf/customers/models.py
loanwolf/requests/locale/fr/LC_MESSAGES/django.po

Na verdade, quero manter todo o arquivo, exceto os três últimos. Como eu pude fazer isso?

No momento, acho que consegui fazer git status | grep -v 'request' . Eu quero git checkout todos os arquivos, exceto os três arquivos.

git status | grep 'modified:' | awk '{print $2}' | xargs git [diff|add|checkout] ??????

    
por J.Doe 16.08.2017 / 21:01

1 resposta

2

Deveria fazer o truque:

git status | awk '{print $2}' | fgrep -v -f list_to_remove

Qual é o conteúdo list_to_remove :

loanwolf/requests/models.py
loanwolf/customers/models.py
loanwolf/requests/locale/fr/LC_MESSAGES/django.po
    
por Ravexina 16.08.2017 / 21:06