如何将一个基于angular的项目推给我自己的git repo?

时间:2021-11-18 07:33:56

So I made a small web app based off of the Angular-Seed project on my local machine. I cloned it from Github and made the project, no problem.

所以我做了一个小的网络应用基于我本地机器上的Angular-Seed项目。我从Github上克隆了这个项目,没问题。

I added all the files/directories without issue, after I deleted the .git directory and .gitignore file from the angular-seed root directory. Running a git status the console reads:

在从angular-seed根目录删除.git目录和.gitignore文件之后,我添加了所有文件/目录,没有问题。运行git状态控制台如下:

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. Can somebody please help me?

目录映射看起来像/home/user/my-local-repo/angular-seed/,其中所有项目文件都位于angular-seed目录中。谁能帮帮我吗?

2 个解决方案

#1


2  

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

git克隆——depth=1{角种子repo link} mynewproject

cd mynewproject

cd mynewproject

rm -rf .git

rm rf .

git init

git init

git remote add origin {repo link}

git远程添加源{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 . Oops! Never committed!

mkdir repo && & cd repo git remote add origin /path/to/origin。git git添加。哦!不要承诺!

git push -u origin master error: src refspec master does not match any. All I had to do was:

git推-u源主错误:src refspec master不匹配任何。我所要做的就是:

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

git提交-m '初始提交' git推源主成功!

source: src refspec master does not match any when pushing commits in git

源:src refspec master在git中推送提交时不匹配任何提交

#2


0  

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:致命:Pathspec在子模块中

#1


2  

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

git克隆——depth=1{角种子repo link} mynewproject

cd mynewproject

cd mynewproject

rm -rf .git

rm rf .

git init

git init

git remote add origin {repo link}

git远程添加源{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 . Oops! Never committed!

mkdir repo && & cd repo git remote add origin /path/to/origin。git git添加。哦!不要承诺!

git push -u origin master error: src refspec master does not match any. All I had to do was:

git推-u源主错误:src refspec master不匹配任何。我所要做的就是:

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

git提交-m '初始提交' git推源主成功!

source: src refspec master does not match any when pushing commits in git

源:src refspec master在git中推送提交时不匹配任何提交

#2


0  

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:致命:Pathspec在子模块中