git command practice, git command _php tutorial

Source: Internet
Author: User
Tags git commands

git command practice, git commands


One, the order

git checkout-b branch name//Create branch and switch to that branch

Git checkout branch name//switch to this branch

Git merge branch name//merge branch into current branch

git branch-d branch name//delete this branch

git branch-d Branch name//FORCE Delete this branch

Git log|head//last Record

git log--pretty=oneline//Lists all commit records as a list

git reset//undo git add after Git commit action

Ii.. gitignore file

*.js//Ignore all. js files

/*.js//Ignore only. js files under the root

Third, the order of the brief solution

There are three major parts of the Git commit: Working tree, index file, commit

Of these three parts:
working tree: The directory in which you work, and whenever you make changes in your code, the state of working tree changes.
Index file : is a working tree and commit bridge, and each time we use the Git-add command to register, the content of the index file changes, and index file and working The tree is in sync.
commit: It's the last stage, only commit, and our code really goes into the git repository. We use Git-commit to commit the content in index file to commit.

①git diff

git diff: is to see the difference between the working tree and the index file.
Git diff--cached: is to see the difference between the index file and commit.
git diff HEAD: It's a look at the difference between working tree and commit.
git diff filename: is the difference between viewing a specific file and the last version.

$ git diff ectemplates_class.Phpdiff--git A/ Public/ectemplates/ectemplates_class.php b/ Public/ectemplates/Ectemindex db83579.. 8fe8090 100644---A/ Public/ectemplates/ectemplates_class.PHP+ + + b Public/ectemplates/ectemplates_class.php@@-420,7 +420,8 @@classEctemplates {if($this->isdbo = = 1) {                        return $out; }-$prostr= "14&]w97) e9\"! b>2!%4u! #35, ' ";+//$prostr = "14&] W97) e9\ "! b>2!%4u! #35, ' ";+$prostr= ''; $outtitle=Convert_uudecode($prostr); if(!Empty($this->CODESOFTDB) &&Admin_from) {                        $key _array=Explode('/',$this-codesoftdb);(END)

http://www.bkjia.com/PHPjc/985088.html www.bkjia.com true http://www.bkjia.com/PHPjc/985088.html techarticle git command practice, git command one, command git checkout-b branch name//Create branch and switch to the branch git checkout branch name//switch to the branch git merge branch name/Merge branch ...

  • Related Article

    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.