سؤال

I have a homework assignment in which I have to view the bootstrap repository. I have to answer this question "What single character was added to a file in commit e17c9 (ignoring any added spaces)? (Hint: ask for a diff.)". I tried running the command "git log -p e17c9" but I can't figure out what single character was changed to the file, the first commit that shows up says "fix dropdowns in subnav" and I don't know where to go from there. Any help would be appreciated thanks.

هل كانت مفيدة؟

المحلول

You single out the line (even though other lines have white spaces) by: git diff -b e17c9~..e17c9

From there you should be able to figure out the character that was added.

نصائح أخرى

Since this is an assignment I don't want to just give you a command to ran, but I would say that there are a lot of clues in the questions.

  1. "Hint: ask for a diff" - You should probably use 'git diff' command
  2. "added to a file in commit 317c9" - You should get a diff between given commit and its parent
  3. "ignoring any added spaces" - You should look up a 'git diff' option for ignoring whitespaces.

Hint: There are questions on stackoverflow about how to lookup SHA of a parent commit or even compare commit with its parent.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top