Git usage.

Source: Internet
Author: User

Git pull = git fetch + git merge.

Set ignored content

For a repository, you can directly create a. gitignore file in the repository directory.

If the configuration file is global, run the following command to specify the global configuration file:

git config --global core.excludesfile=<fileName>



File Content: # starts with a comment, and the others are the file pattern to be ignored.

Git restore File

Git checkout replaces local files

Git Reset: if the file has been added by git, git reset is returned.

If git revert is a commit file, use this.

Git conflicts

Because I only have some knowledge about vim, I chose vimdiff and the command

git mergetool --tool=vimdiff



It was a bit dumpfounded and divided into four screens. The above three are respectively current local, base, and remote

The following screen is merged, and the following content is directly modified, and then wqa is done.

If the modification is complete, you can directly commit it. If you want to roll back, git merge -- abort

Git usage.

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.