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 ...