If you're going to do this, I suggest you just unset the origin as in the second option. git/ directory, but this will still nuke all your history. You can mitigate against (a) by doing something like git clone -depth=1 followed by removing the. The main disadvantages here are (a) having a third-party dependency, possibly using a dev stack you don't want to set up, and (b) losing all commit history as well as the remote. Use a third-party tool like degit that clones without history. The alias above requires the local directory as an argument to get around this. The tricky part there is knowing the name of the directory that was created by the clone so you can cd into it. To make this easier, you could create an alias that does both operations, as above. You evidently added the second origin in an incorrect manner. But I would also suggest that you delete the other origin too and start over. You also need to specify the remote name (origin in. This is not the correct answer, the correct answer is: git remote set-url origin. Where foo is the local directory name you'd like to use.Ĭlone and then remove the origin remote: git clone git remote set-url -delete origin That will delete the deleted origin. Instead, use the git push command with -delete flag, followed by the name of the branch you want to delete. If you use Bitbucket instead of github you will delete the first 'git://' part and directly write :yourusername/reponame.git and of course change the place holders : 'yourusername' and 'reponame' with yours. Then you'd use it like this: git clone-template foo by adding something like this to your ~/.gitconfig: Ĭlone-template = "!f() f" To make this easier, you could create an alias that does it all in one go, e.g. It lists the shortnames of each remote handle you’ve specified. You can create an empty repository and then pull from the source repository without setting a remote: git init foo To see which remote servers you have configured, you can run the git remote command. Cloning sets up a remote, called origin by default, that points to the URL you used to clone. The remote isn't set on GitHub it's set when you clone.
0 Comments
Leave a Reply. |