Git study note 4

Source: Internet
Author: User
Here are two tips for setting git. First, modify git to have excellent unix features (automatically completed). After git is installed successfully, the installation directory will be left behind, this operation is for that directory. [Root @ localhost ~] # Cpgit-1.7.7.4contribcompletiongit-completion.bash ~.. Git-complet

SettingsGitTwo tips

First, the modification gives git excellent unix features (automatically completed)

After successful installation of git, the installation directory will be left behind. This operation is for that directory.

[Root @ localhost ~] #CpGit-1.7.7.4/conTrIb/completion/git-completion.bash ~. // Git-completion.bash // copy this file to a hidden file with the same name under the user's home directory

[Root @ localhost ~] # Vi. bashrc // Add the following sentence

Source ~ /. Git-completion.bash

[Root @ localhost ~] # Source. bashrc

Finally, enter the git work area for testing.

[Root @ localhost ~] #Cd/Git/StatUs/

[Root @ localhost status] # The following occurs when you run the git sta // tab twice.

Stage stash status

This prompt shows a lot of memory for us.CommandIt is undoubtedly a blessing.

Second, set the git command alias

Use the git commit command as an example.

Under normal circumstances, the following is a complete process

[Root @ localhost status] # vi st1

[Root @ localhost status] # gitDdSt1

[Root @ localhost status] # git commit-m "2nd commit"

[Master 41934ca] 2nd commit

1FileS changEd, 1 insertions (+), 0 deletions (-)

Create mode 100644 st1

Let's take a look at the comparison after setting the alias.

[Root @ localhost status] # vi st2

[Root @ localhost status] # git add st2

[Root @ localhost status] # git config -- globalAlias. Ci commit

[Root @ localhost status] # git ci-m "3rd commit"

[Master 6a5cb99] 3rd commit

1 files changed, 1 insertions (+), 0 deletions (-)

Create mode 100644 st2

We can use aliases to simplify commands.

 

Here is a summary of git's other tips and tips for future use.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.