简体   繁体   English

如何将基于 angular-seed 的项目推送到我自己的 git 存储库?

[英]How do I push an angular-seed based project to my own git repo?

So I made a small web app based off of the Angular-Seed project on my local machine.所以我基于本地机器上的 Angular-Seed 项目制作了一个小型网络应用程序。 I cloned it from Github and made the project, no problem.我从 Github 克隆它并制作了该项目,没问题。

I added all the files/directories without issue, after I deleted the .git directory and .gitignore file from the angular-seed root directory.从 angular-seed 根目录中删除.git目录和.gitignore文件后,我添加了所有文件/目录,没有问题。 Running a git status the console reads:运行git status控制台显示:

On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean

However when I add, commit and push to my remote repository, the angular-seed directory (along with the rest of the project files) does not show up.但是,当我添加、提交和推送到我的远程存储库时,angular-seed 目录(以及其余的项目文件)不会显示。

The directory map looks like /home/user/my-local-repo/angular-seed/ where all the project files are in the angular-seed directory.目录映射看起来像/home/user/my-local-repo/angular-seed/ ,其中所有项目文件都在angular-seed目录中。 Can somebody please help me?有人能帮帮我吗?

git clone --depth=1 {angular seed repo link} mynewproject git clone --depth=1 {angular seed repo link} mynewproject

cd mynewproject cd mynewproject

rm -rf .git rm -rf .git

git init混帐初始化

git remote add origin {repo link} git remote add origin {repo link}

source: https://github.com/angular/angular-seed/issues/239来源: https : //github.com/angular/angular-seed/issues/239

You might then get a src refspec error, one solution for that is:然后您可能会收到 src refspec 错误,一个解决方案是:

Maybe you just need to commit.也许你只需要承诺。 I ran into this when I did:当我这样做时,我遇到了这个:

mkdir repo && cd repo git remote add origin /path/to/origin.git git add . mkdir repo && cd repo git remote add origin /path/to/origin.git git add 。 Oops!哎呀! Never committed!从未犯过!

git push -u origin master error: src refspec master does not match any. git push -u origin master 错误:src refspec master 不匹配。 All I had to do was:我所要做的就是:

git commit -m 'initial commit' git push origin master Success! git commit -m 'initial commit' git push origin master 成功!

source: src refspec master does not match any when pushing commits in git来源: 在 git 中推送提交时,src refspec master 不匹配任何内容

Removing the directory from git and adding it again, like this:从 git 中删除目录并再次添加它,如下所示:

git rm --cached directory
git add directory

Source: Git: fatal: Pathspec is in submodule来源: Git:fatal:Pathspec 在子模块中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM