Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Development Tools

Basic Git log questions

git log shows me a history of commits, but seems to open some interactive behavior which I don't know how to close. i.e. I'm not able to issue new git commands without closing my command prompt.

Git 1.8.1 on Windows.

Thanks

5 Answers

Hmm, seems it only happens for a longer log. If I limit to a few commits there's no prob:

git log -2

Turns out pressing q gets me back out to the cmd

awesome! like I said been a LONG time since I have worked on a windows machine. Glad you got it figured out!

Tommy Morgan
STAFF
Tommy Morgan
Treehouse Guest Teacher

Mike Healy -

It looks like Git on Windows is configured by default to use a pager for all output past a certain size. In this case the pager is probably the UNIX program less, which you can read more about here.

If you want to disable this functionality, you have a couple of options:

  1. Use the --no-pager option when you run your command, e.g. git log --no-pager
  2. Switch the pager command to cat for Git. cat simply outputs the content to the terminal, so this would sidestep the use of a pager. You can do this with git config for just your current repository: git config core.pager cat, or for all repositories on your computer: git config --global core.pager cat.

Hope that helps!

Great info, thanks Tommy.

haven't been on a windows machine in a long time..but try ctrl-z

or ctrl-c

Yep, used the classic "press keys one at a time until something works" technique.