Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMike Healy
2,451 PointsBasic 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
Mike Healy
2,451 PointsHmm, 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
Tommy Morgan
Treehouse Guest TeacherIt 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:
- Use the
--no-pager
option when you run your command, e.g.git log --no-pager
- 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!
Mike Healy
2,451 PointsGreat info, thanks Tommy.
Shawn Denham
Python Development Techdegree Student 17,801 Pointshaven't been on a windows machine in a long time..but try ctrl-z
Shawn Denham
Python Development Techdegree Student 17,801 Pointsor ctrl-c
Mike Healy
2,451 PointsYep, used the classic "press keys one at a time until something works" technique.
Shawn Denham
Python Development Techdegree Student 17,801 PointsShawn Denham
Python Development Techdegree Student 17,801 Pointsawesome! like I said been a LONG time since I have worked on a windows machine. Glad you got it figured out!