Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
May 11, 2021 08:44 pm GMT

How To Avoid Getting Stuck in Vim as a New git User

If you're like me, when you get a new machine from work, the first thing you do is slap zsh on it, pull down your new repos, and start digging. It's all fun and games until you run git branch and BLAM, you're stuck in Vim-land now, hope you brought a towel. I've seen more than a few new developers get stuck here, and I've had to embarrassingly ask for help myself, so if you're finding yourself stuck in this situation, know that you're not alone and you'll be ok. Just type :wq and you should return to the terminal. However, if you want to prevent this happening again, read on.

WARNING: This change is global and will affect all your git repositories. See the link below for details if you want to control this setting per repo.

git config --global core.pager cat

This command modifies the global git configuration to use the tool cat as the terminal pager for all your future git commands. By default, on a new Mac with zsh installed, Vi is used... or Vim... I still don't really understand the difference, but it's one of them and you can't get out without :wq.

Remember that after changing any configurations, you will need to re-launch your terminal to see changes take effect.

Source: StackOverflow


Original Link: https://dev.to/samelawrence/my-favorite-git-one-liners-1di7

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To