The last time I wrote a useful and simple Git tutorial, the feedback I got was beyond my expectations.

Two days ago, WHEN I copied the articles on the wechat official account on Nuggets, Jane book and CSDN, the reading volume and the number of likes was blinding me…

Logically speaking, write good, as my public number of readers, you are I from other platforms hard bit by bit of digging, to me more recognition just right, incredibly few people to me point “good-looking”, also did not see you who share forwarding

My public number of all the articles like and read the number of all add up, not copy of the past article tenth, let me very sad ah, point “good-looking” to express the recognition of my text, I have more motivation to write better text to share with you ah

As a main wechat public number of the number, to rely on other platforms like data, to obtain a sense of achievement, I think I am mixed enough miserable.

The good news is that someone recently wrote me a note saying that “I remembered the GIT command line because I read my article.” After hearing it, I was so happy

GIt is a good thing. After using GIt, the other version controllers are really hard to use, and the command line is really good

Git command execution in the previous article has basically solved 95% of the problems. (Just from a developer’s perspective)

This time do a little supplement, and share a small skill to you, great easy to use, but also can install force!

Advanced use of Git Log

Git logs are too much for each commit, too much interference, and you can’t see the merge of branches.

Git command line: Git command line: Git command line: Git command line: Git command line: Git command line: Git command line

git log –graph –pretty=format:’%Cred%h%Creset – %C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset’ –abbrev-commit –date=relative

Let me show you what it looks like. Isn’t it awesome?

How are we supposed to remember a command line that is so long and complex? Don’t panic. I got one more good thing for you

Git alias is a Git alias operation. Using this command, you can greatly improve the efficiency of your command line input

Alias efficiency is king

We often use commands like branch, checkout, and commit. These commands are simple, but they are difficult to type. As a programmer, the purpose of developing programs is to improve efficiency

Take the following example:

git config --global alias.ck checkout

git config --global alias.br branch

git config --global alias.ck commit
Copy the code

Once configured, we can use commands like git checkout to type git ck. Is it 666?

The xx after the alias.xx dot represents the alias we set. To use it, just type the alias

Git log: git log: git log: git log: git log: git log: git log: git log

If you don’t want to make any changes, just type git lg

git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset - %C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
Copy the code

I’ll show you a picture

After execution, use when directly open the console input git LG, and install force, and save trouble

By the way, Git command line operation, copy is CTRL + INSERT, paste is Shift + INSERT, view the log, press “enter” to load more log information, press Q to exit the log view

During commit after merge, occasionally a Linux dialog box will pop up asking you to write notes

This requires a Linux command to operate

Press I to enter the dialog box editing mode, write the commit remarks, press ESC to exit the editing mode, press :+wq to exit and save the configuration

Why the command line?

You should all know that the third-party interface software to operate Git, in essence, are using the Git command line, some complex operations are directly put together after the direct execution of Git, but the software package them, do not let us see the command line just

I used to use the Git command line with visual third-party software, but I always found that I had puzzling problems and error messages that seemed to confuse me, so I just learned to use the command line

After using the command line, I found that the execution speed and accuracy were much higher than the efficiency of using third-party software, and some puzzling problems were never encountered again

Because the software is to encapsulate a series of Git commands, and our own use, Git commits logical order we are very clear, so step by step, as long as the logic is right, won’t make a mistake, even if make a mistake, the command line, where is wrong, how to correct and prompt loud and clear, This also saves us with the interface software error to find Baidu time.

The command line is a bit awkward at first, but once you get used to it, you won’t want to open third-party software at all

Of course, technology is just a tool, and the purpose of tools is to improve efficiency. If you feel that you can be more efficient using guI-based software, just do it your way.

Like me, I am in the pursuit of efficiency at the same time, but also want to be able to pretend ~~

As a Windows ecosystem programmer, everything is visual, and the only time I can be a bit geeky in the movies is with Git command line…

After all, every time I use Git, I feel like a geek in a movie with commands popping up on my screen

Write in the last

This weekend, I’m going to come up and talk to you, and I’m going to share two tips. It’s gonna be like this every week, of course, but I mean, once a week, I’m gonna share a little trick or something, and when I’m in a good mood, I’m gonna do it, right

Tips to share what, the scope of sharing you can tell me what you want to see the backstage message, I will write more you want to see, anyway, while now paying attention to my people are not many, basically everyone can take care of, now do not squeeze me, when to wait?

Scan the wechat public account “Nao Nao Eat fish” and share it every day