Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

git clone with project name and depth=1 #239

Closed
santiagobasulto opened this issue Oct 23, 2014 · 3 comments · Fixed by brandonroberts/angular-seed#1
Closed

git clone with project name and depth=1 #239

santiagobasulto opened this issue Oct 23, 2014 · 3 comments · Fixed by brandonroberts/angular-seed#1

Comments

@santiagobasulto
Copy link

On the readme there's a standar clone. Maybe it can be improved a little bit (git beginners might not be aware of this and can be useful for them):

git clone --depth=1 https://github.com/angular/angular-seed.git <your-project-name>

Btw, sorry to include this in an issue, but forking and PRing just for this seemed like a waste of time.

@petebacondarwin
Copy link
Contributor

Good idea. I will update the README.

@toddwseattle
Copy link

I liked the idea of this and tried it; but I couldn't figure out how to push to a new repository on github.com with a depth of 1; e.g. my flow with angular-seed is to do:

git clone https://github.com/angular/angular-seed mynewproject
cd mynewproject
git remote set-url origin https://myname/mynewproject
git push origin master

But this fails if the clone is done with --depth=1 on the push back to github. Perhaps there is a workaround, but I'm not enough of a git wizard to make work.

@petebacondarwin
Copy link
Contributor

If you only want to have a copy of the repository without the history then just delete the .git folder after cloning and then re-initialize the repository:

git clone --depth=1 https://github.com/angular/angular-seed mynewproject
cd mynewproject
rm -rf .git
git init
git remote add origin https://github.com/myname/mynewproject

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants