I use Putty to apply cloze module patch. Here are my steps:

  1. I go to this directory: sites/all/modules/contrib/cloze

  2. I save the patch: wget https://www.drupal.org/files/issues/cloze-report_form_quiz_compatibility_fixed-2216049-1.patch Save as: cloze-report_form_quiz_compatibility_fixed-2216049-1.patch

  3. I apply patch: git apply cloze-report_form_quiz_compatibility_fixed-2216049-1.patch (nothing happen. no error)

  4. I check the status: git status


fatal: Not a git repository (or any of the parent directories): .git

How come?

  • 1
    Because the folder you're executing git in is not a git repository – Clive Jun 9 '16 at 7:48
  • @Clive, I had added the question – learnallskill Jun 9 '16 at 8:23
  • 1
    git apply works only on tracked files, so if you're not source controlling your current file that you're trying to apply a patch to, then just do patch -p1 < patchname.patch instead of git apply – Beebee Jun 9 '16 at 8:54
  • @Beebee, Thanks. I learn how to patch a file from you. However, this patch never help me to solve my problem. Lol – learnallskill Jun 9 '16 at 10:03

After your step 1, make sure to initialize the GIT repository, which will add the .git directory, subdirectories and files that store your repository data.

To do so, just use command git init while in your directory sites/all/modules/contrib/cloze.

If you're new to using GIT with Drupal, you may want to look at the community documentation located at Building a Drupal site with Git (+ its child pages).

  • Vriens, I had edited the question – learnallskill Jun 9 '16 at 8:22
  • 1
    Please don't do that @learnallskill - once a question has been answered (and correctly as in this case), you can't edit it to ask a different question altogether. It invalidates the existing answer which is both unfair to the person who answered it, and confusing for people who come across the question again. With the best will in the world, I don't think you need help with Drupal, but instead need to get a basic understanding of how git works. We can't help with that here, unless there's something very specific about Drupal you need to know. The edit you made was a generic git question – Clive Jun 9 '16 at 8:38
  • (as is this one, so don't be too surprised if the community eventually vote to close this) – Clive Jun 9 '16 at 8:42
  • @learnallskill I'll leave it for the community to decide on something like this, it's always useful to know this sort of stuff in a Drupal context so it's a bit of a grey area. Just in case you do need a starting-place for git, this free book is excellent BTW – Clive Jun 9 '16 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.