如何将yii2项目推送和克隆到github?

时间:2016-01-04 10:15:04

标签: github yii2 composer-php

我用yii2开发了一个简单的web应用程序并将其推送到我的github存储库。我试图将它克隆到另一个文件夹并测试它,但它没有用。

有些东西告诉我,这是因为我从没有作曲家的档案中获取了我的yii2,当我尝试克隆它时,我使用composer install命令来获取供应商文件夹和自动加载文件,但它没有正确执行。

为什么会发生这种情况?如何将我的网络应用程序正确地推送到github,以便每个人都可以克隆并启动它们?提前谢谢。

1 个答案:

答案 0 :(得分:-1)

一旦您完成了本地的Yii2应用程序,请按照以下Git的基本命令进行操作。

Git基本命令

Git Checkout:

$ git clone CHECKOUT_URL

检查git文件状态:

$ git status

将所有文件添加到git:

$ git add *

将所选文件添加到git:

$ git add filename1, filename2

将所有添加/更新/删除的文件提交到Git:

$ git commit -m "initial commit" *

将所选文件提交到git

$ git commit -m "initial commit" filename1, folder1

将提交的文件推送到Git master分支:

$ git push -u origin master

要查看所有存在的分支:

$ git branch

创建新分支:

$ git branch changes

选择分支:

$ git checkout changes

提交到选定的分支“更改”:

 $ git push origin changes

其他Git命令:

$ git --help
usage: git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           [-c name=value] [--help]
           <command> [<args>]

The most commonly used git commands are:
   add        Add file contents to the index
   bisect     Find by binary search the change that introduced a bug
   branch     List, create, or delete branches
   checkout   Checkout a branch or paths to the working tree
   clone      Clone a repository into a new directory
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   fetch      Download objects and refs from another repository
   grep       Print lines matching a pattern
   init       Create an empty git repository or reinitialize an existing one
   log        Show commit logs
   merge      Join two or more development histories together
   mv         Move or rename a file, a directory, or a symlink
   pull       Fetch from and merge with another repository or a local branch
   push       Update remote refs along with associated objects
   rebase     Forward-port local commits to the updated upstream head
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index
   show       Show various types of objects
   status     Show the working tree status
   tag        Create, list, delete or verify a tag object signed with GPG