Home > Backend Development > PHP Tutorial > git command practice, git command_PHP tutorial

git command practice, git command_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 09:57:01
Original
1393 people have browsed it

Git command practice, git command

1. Command

git checkout -b branch name //Create a branch and switch to this branch

git checkout branch name //switch to this branch

git merge branch name //Merge the branch to the current branch

git branch -d branch name //Delete the branch

git branch -D branch name //Force delete the branch

git log|head //The latest record

git log --pretty=oneline //List all commit records in list form

git reset //Undo the operations after git add and before git commit

2. .gitignore file

*.js //Ignore all .js files

/*.js //Only ignore the .js files under the root

3. Brief explanation of commands

In the git submission process, there are three parts: working tree, index file, commit

Among these three parts:
working tree: is the directory where you work. Whenever you make changes in the code, the status of the working tree changes.
index file: is the index file, which is the bridge connecting the working tree and commit. Whenever we use the git-add command to register, the content of the index file changes. At this time, the index file is the same as the working tree. The tree is synchronized.
commit: is the final stage. Only after commit can our code actually enter the git warehouse. We use git-commit to submit the contents of the index file to commit.

①git diff

git diff: checks the difference between working tree and index file.
git diff --cached: checks the difference between index file and commit.
git diff HEAD: View the difference between working tree and commit.
git diff filename: View the difference between a specific file and the previous version.

$ git diff ectemplates_class.<span>php
diff </span>--git a/<span>public</span>/ectemplates/ectemplates_class.php b/<span>public</span>/ectemplates/<span>ectem
index db83579</span>..8fe8090 100644
--- a/<span>public</span>/ectemplates/ectemplates_class.<span>php
</span>+++ b/<span>public</span>/ectemplates/ectemplates_class.<span>php
@@ </span>-420,7 +420,8 @@ <span>class</span><span> Ectemplates {
                </span><span>if</span> (<span>$this</span>->isdbo == 1<span>) {
                        </span><span>return</span> <span>$out</span><span>;
                }
</span>-               <span>$prostr</span> = "14&]W97)E9\"!B>2!%4U!#35,`"<span>;
</span>+               <span>//</span><span>$prostr = "14&]W97)E9\"!B>2!%4U!#35,`";</span>
+               <span>$prostr</span> = ''<span>;
                </span><span>$outtitle</span> = <span>convert_uudecode</span>(<span>$prostr</span><span>);
                </span><span>if</span> (!<span>empty</span>(<span>$this</span>->codesoftdb) &&<span> admin_FROM) {
                        </span><span>$key_array</span> = <span>explode</span>('/', <span>$this</span>-><span>codesoftdb);
(</span><span>END</span>)
Copy after login

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/985088.htmlTechArticlegit command practice, git command 1, command git checkout -b branch name//Create a branch and switch to the branch git checkout branch name//switch to the branch git merge branch name//merge the branch...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
git commit message problem
From 1970-01-01 08:00:00
0
0
0
git - no changes commit?
From 1970-01-01 08:00:00
0
0
0
Return value of transaction commit?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template