I'm using git clone --reference
to reduce network traffic over a slow connection.
Now, git-clone
's man page points out the dangers of using this and suggests git repack -a
to break the link, which I'm doing immediately after the clone.
What I'd like to know is - after I've done the repack, is it then safe to just delete .git/objects/info/alternates
or is there a proper git command to do this?
Thanks
Create a new repository on GitHub. Clone your repository to your local computer. Modify files in your repository and track changes using commits with git. Push your changes back to GitHub.
While you can clone repositories with the git clone command, keep in mind that this clones the branch and the remote HEAD . This is usually master by default and includes all other branches in the repository. So when you clone a repository, you clone the master and all other branches.
git clone --mirror In addition, --mirror will clone all the extended refs of the remote repository, and maintain remote branch tracking configuration. You can then run git remote update on the mirror and it will overwrite all refs from the origin repo.
Note that git clone
now has a new --dissociate
option that does this. It was added in Git 2.3: https://github.com/blog/1957-git-2-3-has-been-released
The option simply calls git repack -a -d
and deletes .git/objects/info/alternates
. So yes, it is safe. (Source: https://github.com/gitster/git/commit/d35c8027937546e6b22a2f28123f731c84e3b380)
OK, so I found out. The answer is yes, it is safe to delete alternates directly. And no, there is no git command to do this.
http://thread.gmane.org/gmane.comp.version-control.git/141161/focus=141199
I know it's not the done thing to answer your own question, but we have to move on!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With