AngularJs / GitHub:如何在没有任何历史记录的情况下将angular-seed克隆到我的新项目?

时间:2022-05-19 07:22:02

I have followed the steps from the below documentation from angular-seed github page and created a new project and pushed my project to github as https://github.com/selvaonline/StickyTodos , but still i am seeing the history of old remote angular-seed's history and contributors. I have done unshallow my old cloned repo but still i am getting the old history.

我已经按照angular-seed github页面下面的文档中的步骤创建了一个新项目并将我的项目推送到github,如https://github.com/selvaonline/StickyTodos,但我仍然看到旧远程角度的历史 - 种子的历史和贡献者。我已经完成了我的旧克隆回购,但我仍然得到了旧的历史。

From Angular-Seed Documentation which i followed... If you just want to start a new project without the angular-seed commit history then you can do:

来自我遵循的Angular-Seed文档...如果您只想在没有angular-seed提交历史的情况下启动新项目,那么您可以执行以下操作:

git clone --depth=1 https://github.com/angular/angular-seed.git The depth=1 tells git to only pull down one commit worth of historical data.

git clone --depth = 1 https://github.com/angular/angular-seed.git depth = 1告诉git只提取一个提交的历史数据。

Steps which involved to create the github project

涉及创建github项目的步骤

Step 1: Clone the angular-seed to my local repo

第1步:将角种子克隆到我当地的仓库

C:\Projects\StickyTodos>git clone --depth=1 https://github.com/angular/angular-seed.git

I have created the ssh key and added to my github account. then i have followed the below steps.

我创建了ssh密钥并添加到我的github帐户。然后我按照以下步骤。

Selva@SelvaOnline MINGW64 ~/.ssh
$ ssh-add git_rsa
Identity added: git_rsa (git_rsa)

Selva@SelvaOnline MINGW64 ~/.ssh
$ ssh -T git@github.com
Warning: Permanently added the RSA host key for IP address '192.XX.XXX.XXX' to the list of known hosts.
Hi selvaonline/StickyTodos! You've successfully authenticated, but GitHub does not provide shell access.

Selva@SelvaOnline MINGW64 /c/projects/StickyTodos (master)
$ git remote set-url origin https://github.com/selvaonline/StickyTodos.git



Selva@SelvaOnline MINGW64 /c/projects/StickyTodos (master)
$ git remote add old https://github.com/angular/angular-seed.git

Selva@SelvaOnline MINGW64 /c/projects/StickyTodos (master)
$ git fetch --unshallow old
remote: Counting objects: 2555, done.
remote: Compressing objects: 100% (983/983), done.
remote: Total 25Receiving objects55 (de: lt 99% (a 14254129), reused 25/229 (555), delta 111.7403), 7 paMiB ck| 340.00-reu Ksed iB0[K
Receiving objects: 100% (2555/2555), 11.91 MiB | 340.00 KiB/s, done.
Resolving deltas: 100% (1429/1429), completed with 14 local objects.
From https://github.com/angular/angular-seed
 * [new branch]      master     -> old/master
 * [new branch]      move-bower -> old/move-bower
 * [new branch]      v0.10.x    -> old/v0.10.x


$ git remote set-url origin https://github.com/selvaonline/StickyTodos.git


Selva@SelvaOnline MINGW64 /c/projects/StickyTodos (master)
$ git add .

Selva@SelvaOnline MINGW64 /c/projects/StickyTodos (master)
$ git commit -m "First Commit"
[master a4667c4] First Commit
 1 file changed, 1 deletion(-)
 delete mode 160000 angular-seed

Selva@SelvaOnline MINGW64 /c/projects/StickyTodos (master)
$ git push origin
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

Counting objects: 2590, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (994/994), done.
Writing objects: 100% (2590/2590), 11.92 MiB | 606.00 KiB/s, done.
Total 2590 (delta 1438), reused 2558 (delta 1424)
To https://github.com/selvaonline/StickyTodos.git
 * [new branch]      master -> master

So i have my angular-seed cloned local repo and it has been pushed to github remote repo. What is the best solution you can give me to remove the angular-seed's history from my project?

所以我有我的angular-seed克隆本地回购,它已被推送到github远程回购。你可以从我的项目中删除angular-seed历史的最佳解决方案是什么?

1 个解决方案

#1


0  

There was an issue with angular syntax on angular-seed github documentation page.

angular-seed github文档页面上存在角度语法问题。

git clone --depth=1 https://github.com/angular/angular-seed.git (as per documentation)

git clone --depth = 1 https://github.com/angular/angular-seed.git(根据文档)

git clone --depth 1 https://github.com/angular/angular-seed.git (correct syntax)

git clone --depth 1 https://github.com/angular/angular-seed.git(正确的语法)

Thanks @Jeff Auriemma (http://jdauriemma.com/)

谢谢@Jeff Auriemma(http://jdauriemma.com/)

#1


0  

There was an issue with angular syntax on angular-seed github documentation page.

angular-seed github文档页面上存在角度语法问题。

git clone --depth=1 https://github.com/angular/angular-seed.git (as per documentation)

git clone --depth = 1 https://github.com/angular/angular-seed.git(根据文档)

git clone --depth 1 https://github.com/angular/angular-seed.git (correct syntax)

git clone --depth 1 https://github.com/angular/angular-seed.git(正确的语法)

Thanks @Jeff Auriemma (http://jdauriemma.com/)

谢谢@Jeff Auriemma(http://jdauriemma.com/)