Use GitHub to host the Larval framework

Source: Internet
Author: User
Tags composer install git client
: This article mainly introduces how to use GitHub to host the Larval framework. For more information about PHP tutorials, see. Each new framework has its own installation method. the installation methods of laravel include:

(1) install Laravel by downloading the Laravel package
(1) install Composer
(2) Download the latest Larvel framework
(3) install git
(4) decompress the downloaded Laraval to a directory and run the: composer install command in git to install all the framework dependency packages.
(5) update the Laravel framework and use composer update.

(2) installation through ComPoser
(1) install ComPoser
(2) execute the command: composer create-project laravel/laravel -- prefer-dist

(3) installation through Laravel installer
(1) first, download the Laravel installer through Composer. composer global require "laravel/installer = ~ 1.1"

(2) modify environment variables:
~ /. Add the composer/vendor/bin PATH to the PATH environment variable.
(3) after the installation is successful, run the laravel new command to create a newly installed Laravel in the directory you specified.
For example, laravel new blog will create a directory named blog under the current directory, which stores the newly installed
Laravel and its dependent toolkit. This installation method is much faster than using Composer.

(4) install ComPoser official method:
Http:// \
(1) use php for installation
Because I am using xampp, first use the dos command in cmd to Enter C: \ xampp \ php and then use
C: \ xampp \ php> php-r "readfile ('https: //');" | php
Run the following code to create a batch file and place it in the environment variable.
C: \ bin> echo @ php "% ~ Dp0composer. phar "% *> composer. bat
Close the DOS window and open it again. running the following code properly indicates that the installation is successful (The Crab test is problematic)
C: \ Users \ username> composer-V
Composer version 27d8904
(2) use a client to install: composer
(3) installation in linux
A download composer. phar
Curl-sS | php
B. move composer. phar to the environment to make it executable.
Mv composer. phar/usr/local/bin/composer
C. test (the installation process of crabs is normal)
[Root @ **************** ~] # Composer-V

(5) gitLub hosting service
1. register an account and create a warehouse
To use github, the first step is to register a github account. Then you can Create a Repository (free users can only Create a public Repository), Create a New Repository,
After you fill in the name and Create, some repository configuration information will appear, which is also a simple git tutorial.
2. install the client msysgit
Github is a server. to use git on your computer, we still need a git client. here I use msysgit, which only provides the core features of git and is based on command line.
If you want a graphical interface, you only need to install TortoiseGit on the basis of msysgit.
After installing msysgit, right-click and choose "Git Init Here" in the local repository to add a. git folder, which indicates that the local git is successfully created.
Right-click Git Bash and enter the git command line. to upload the local repository to github, you also need to configure the ssh key.
3. configure Git
First, create an ssh key locally;
$ Ssh-keygen-t rsa-C ""
After the is changed to your mailbox, will ask to confirm the path and enter the password, we use the default one-way carriage return on the line. If it succeeds ~ /To generate the. ssh folder,
Go in, open, and copy the key.
Go back to github, go to Account Settings, select SSH Keys on the left, Add SSH Key, enter the title, and paste the key. In git bash, enter:
$ Ssh-T
If this is the first time, You will be prompted whether to continue. if You enter yes, You will see: You 've successfully authenticated, but GitHub does not provide shell access. This indicates that github has been successfully connected.
Next, we need to upload the local repository to github. Before that, we need to set username and email, because every time github commit records them.
$ Git config -- global user. name "your name"
$ Git config -- global user. email ""
Go to the repository to be uploaded, right-click git bash, and add the remote address:
$ Git remote add origin yourName/yourRepo. git
YourName and yourRepo indicate your github user name and the newly created repository. git, open config, and there will be an additional remote "origin" content, which is the remote address just added,
You can also directly modify config to configure the remote address.
4. submit And Upload
Next, add some files in the local repository, such as README,
$ Git add README
$ Git commit-m "first commit"
Upload to github:
$ Git push origin master
The git push command pushes the local repository to the remote server.
The git pull command is the opposite.
After the code is modified, you can use git status to view the differences between files. you can also use git add to add files to commit, or use git add-I to intelligently add files. After that, git commit submits this modification and git push uploads it to github.
5. gitignore file
. Gitignore indicates the file to be ignored by git, which is a very important and practical file. Generally, after writing the code, we will perform compilation, debugging, and other operations. during this period, many intermediate and executable files will be generated,
These are not code files and do not need to be managed by git. We will see A lot of such files in git status. if you use git add-A to add them, it will be too troublesome to manually add them one by one.
Then we need. gitignore. For example, in c # Projects, my. gitignore is written as follows:
*. Suo
Bin and obj are compiling directories, which are not source code and ignored. suo files are vs2010 configuration files and are not required. In this way, you will only see the source code file during git status, so you can safely add-A to git.
6. tag
We can create a tag to point to a critical period in software development. for example, when the version number is updated, we can create a tag such as "v2.0" and "v3.1, in this way, it will be more convenient for future review.
Tag is easy to use. the main operations include viewing tags, creating tags, verifying tags, and sharing tags.
6.1 view tags
List all tags:
Git tag
The tags listed in this way are sorted alphabetically and do not matter when the tag is created. If you only want to view some tags, you can add restrictions:
Git tag-l v1 .*
In this way, only version 1. is listed.
6.2 create a tag
Create a lightweight tag:
Git tag v1.0
The created tag does not contain any other information, and corresponds to the tag with information:
Git tag-a v1.0-m 'first version'
-M is followed by the annotation information, which will be useful for future viewing. this is a common tag, and there is a signature tag:
Git tag-s v1.0-m 'first version'
The premise is that you have a private key for GPG, just replace a with s. In addition to adding tags for the current progress, we can also add tags for the previous commit:
# First view the previous commit
Git log -- oneline
# Assume there is a commit: 8a5cbc2 updated readme
# Add tags for him
Git tag-a v1.1 8a5cbc2
6.3 delete tags
Very easy. after knowing the tag name:
Git tag-d v1.0
6.4 verify tag
If you have a GPG private key, you can verify the tag:
Git tag-v v1.0
6.5 shared tag
When we execute git push, the tag will not be uploaded to the server. for example, after the tag is created on github, the tag cannot be seen on the github webpage, to share these tags, you must:
Git push origin -- tags

The above describes how to use GitHub to host the Larval framework, including some content, and hope to be helpful to anyone interested in PHP tutorials.

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