我用 yii2 开发了一个简单的网络应用程序并将其推送到我的 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 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
关于github - 如何将 yii2 项目推送和克隆到 github?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34588824/