![]() gitignore file that specifies which files you want to exclude from version control. excludesfile = ~/.gitignore lets you specify the global.I'm not using Vim for coding, but for quick edits like that, I prefer it over Sublime or VS Code. editor = vim sets which editor you want to use for editing commit messages (if this value is not set, git will first try to read what editor you are using from the environment variables VISUAL or EDITOR and if that fails, it will fall back to vi).The core section contains various different settings related to git. ![]() # Configure Git on OS X to properly handle line endings Pager = diff-so-fancy | less -tabs = 4 -RFX It's very easy to set up and gives a new look to the git diff output, so make sure to check it out. For diff-ing, I'm using the diff-so-fancy tool. The diff and diff-highlight sets the colors that will be used in the git diff commands. The branch and status sections are changing the output colors of git branch and git status commands in the following way: The ui = auto is the default setting for the UI - it colors the output when it's going straight to a terminal, but omits the color-control codes when the output is redirected to a pipe or a file. I copy-pasted it from somewhere, but you should check it out - it gives you a nice, concise graph of how the repository has evolved over time. Also, no, I did not write the formula for lg myself ). Otherwise, I've noticed that I was creating duplicates all over the file. I like to keep my aliases sorted alphabetically. Lg = log -graph -all -format =format: '%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)- %an%C(reset)%C(bold yellow)%d%C(reset)' -abbrev-commit -date =relative It's quite a common practice to alias many of git's commands to a 1- or 2-letter shortcut, for example: Git aliases are exactly what they sound - they let you call a specific function through a different name. On your journey to mastering git, you will be adding more and more of them. ![]() #Īliases are probably the biggest part of. And if you like something, feel free to copy the code (you can find my. So, let's take a look at what you might find in a. You will learn about some features that you probably didn't know existed, and you will be able to configure that tool to work in a way you like the most. gitconfig file in your home directory.Īs with every tool, it's worth spending some time to figure out how you can configure it. ![]() Once you run those two commands, they will end up in the. It will even show you how to do this: git config -global user.email " " Before you can create your first commit, git will ask you to configure your name and email. gitconfig file - the configuration file of git. ![]() One of the first things that you will encounter as you begin to delve deeper into git is the. " how to make your colleagues hate you"), reflog, submodules, hooks and more. The more you use git, the more advanced topics you discover: blaming, bisecting, rewriting history (a.k.a. Then a day comes when you release the first official version of your software on GitHub, so you learn about tags. Later, you may decide to start collaborating with someone on the code, so you introduce the concept of branches and pull requests. You learn a handful of commands: commit, checkout, push, pull, status, and diff, and you're ready to go. If you want to start with a simple workflow, where you write some code and add it to the master branch - that's fine. It doesn't force you to use it in a particular way. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |