Удалить каталог из удаленного репозитория после добавления его в .gitignore

Intent intent = new Intent(Intent.ACTION_MAIN);
        intent.setComponent(new ComponentName("package_name","package_name.class_name"));
        intent.putExtra("grace", "Hi");
        startActivity(intent);
519
задан melpomene 23 July 2015 в 20:33
поделиться

1 ответ

Этот метод применяет стандарт .gitignore поведение, и не требует вручную определения файлов, которые должны быть проигнорированы .

не Может использовать --exclude-from=.gitignore больше:/-Вот обновленный метод:

Общие рекомендации: запускаются с чистого repo - все фиксировавшее, ничто ожидающее в рабочем каталоге или индексе, и делают резервное копирование !

#commit up-to-date .gitignore (if not already existing)
#this command must be run on each branch
git add .gitignore
git commit -m "Create .gitignore"

#apply standard git ignore behavior only to current index, not working directory (--cached)
#if this command returns nothing, ensure /.git/info/exclude AND/OR .gitignore exist
#this command must be run on each branch
git ls-files -z --ignored --exclude-standard | xargs -0 git rm --cached

#optionally add anything to the index that was previously ignored but now shouldn't be:
git add *

#commit again
#optionally use the --amend flag to merge this commit with the previous one instead of creating 2 commits.

git commit -m "re-applied modified .gitignore"

#other devs who pull after this commit is pushed will see the  newly-.gitignored files DELETED

, Если также необходимо произвести чистку недавно проигнорированных файлов от истории фиксации ответвления или если Вы не хотите, чтобы недавно проигнорированные файлы были удалены из будущих получений по запросу , см. этот ответ .

2
ответ дан 22 November 2019 в 22:18
поделиться
Другие вопросы по тегам:

Похожие вопросы: