Knowledge of version control using Git in the PHP yii framework

Source: Internet
Author: User
Tags using git yii

Git's definition of Wikipedia: It's a free, distributed version Control tool, or a source code management tool that emphasizes fast. Git was originally developed by Linus Torvalds to manage the development of the Linux kernel. Each git working directory is a completely separate code base with complete history and version tracking capabilities, independent of the network and hub servers.
Some commands and commands related to git version control.


Initialize two basic commands
git init. is to create a repository in the current directory


git clone git://github.com/someone/some_project.git some_project

is to completely clone the original remote repository to the local some_project directory


git remote add orgin git://github.com/someone/another_project.git



Git view commands for remote repositories
git remote-v


Update the code for the Origin repository to the local master branch


git pull Origin master//update local git repository


Commands to resolve matching relationshipscomposer Update-o-VVV


Create a virtual directory


cd/etc


To configure the virtual directory by editing the files inside the server


Then, by editing the Hosts file inside the server, you can point the virtual path you want to create to local
Restart Service:
service Nginx (server name) Restart
To update git's related commands:

To view the relevant commands for the local library:git status (view the relevant state of the local library)


To add to a local library:

git add-a

git add-a
Git commit-a-M "Upadte"

Commands to upload to the server:

Git push Origin Master


Download the command to the local library update:

Git pull Origin Master



#初始化一个版本仓库
Git init


#Clone远程版本库
git clone [email protected]:wordpress.git


#添加远程版本库origin, syntax for git remote add [shortname] [url]
git remote add origin [email protected]:wordpress.git


#查看远程仓库
Git remote-v




#添加当前修改的文件到暂存区
git Add.


#如果你自动追踪文件, including files that you have manually deleted with a status of deleted
Git add-u


#提交你的修改
Git commit–m "Your comment"


#推送你的更新到远程服务器, syntax for git push [remote name] [local branch]:[remote branch]
Git push Origin Master


#查看文件状态
git status


#跟踪新文件
git add readme.txt


#从当前跟踪列表移除文件, and completely remove
git rm readme.txt


#仅在暂存区删除, keep files in current directory, no longer track
Git rm–cached readme.txt


#重命名文件
git mv Reademe.txt Readme


#查看提交的历史记录
git log


#修改最后一次提交注释的, using the –amend parameter
git commit--amend


#忘记提交某些修改, the following three commands will only get one commit.
git commit–m "add readme.txt"
git add Readme_forgotten
Git commit–amend


#假设你已经使用git Add, add the modified files A, B to staging area


#现在你只想提交a文件, do not want to submit B file, this should be
git reset HEAD b


#取消对文件的修改
Git checkout–-readme.txt

Knowledge of version control using Git in the PHP yii framework

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.