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



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

有东西告诉我,这是因为我从一个没有composer的存档中获取yii2,当我试图克隆它时,我使用composer install命令来获取供应商文件夹和自动加载文件,但它做得不对。

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

一旦您将Yii2应用程序准备好进入本地,请按照以下Git的基本命令进行操作。

Git基本命令

Git结账:

$ 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主分支:

$ 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

相关内容

  • 没有找到相关文章

最新更新