Chapters ▾ Show
2nd Edition A1.7 Appendix A: Git in Other Environments - Git in Zsh Zsh also ships with a tab-completion library for Git. To use it, simply run
Ambiguous tab-completions aren’t just listed; they have helpful descriptions, and you can graphically navigate the list by repeatedly hitting tab. This works with Git commands, their arguments, and names of things inside the repository (like refs and remotes), as well as filenames and all the other things Zsh knows how to tab-complete. Zsh ships with a framework for getting information from version control systems, called
This results in a display of the current branch on the right-hand side of the terminal window, whenever your shell is inside a Git repository. The left side is supported as well, of course; just uncomment the assignment to PROMPT. It looks a bit like this: Figure 159. Customized Zsh is powerful enough that there are entire frameworks dedicated to making it better. One of them is called "oh-my-zsh", and it can be found at https://github.com/robbyrussell/oh-my-zsh. oh-my-zsh’s plugin system comes with powerful git tab-completion, and it has a variety of prompt "themes", many of which display version-control data. An example of an oh-my-zsh theme is just one example of what can be done with this system. Figure 160. An example of an oh-my-zsh theme How do I fix a non repository in git?To do so, you need to navigate to the correct folder and then run the command git init , which will create a new empty Git repository or reinitialize an existing one.
What does it mean not a git repository?The “not a git repository” error is common. The cause is running a Git command in the wrong folder or running a Git command before initializing a Git repository.
How do I automatically update my oh my zsh?Usage. Add autoupdate to the plugins=() list in your ~/. zshrc file and you're done. The updates will be executed automatically as soon as the oh-my-zsh updater is started.
Does git work with zsh?git-prompt.sh is compatible with both Bash and Zsh. Zsh is powerful enough that there are entire frameworks dedicated to making it better.
|