An option with multiple parameters is simply insane. Introduce a new syntax that takes these three things concatenated together with a comma, which makes the command line syntax more uniform across subcommands, while retaining the traditional syntax for backward compatiblity. Note: only git 2. Tags: file , git. November 20, Git Leave a comment. Questions: I want to convert mercurial repo to git repo.
But you can do a shallow clone using the --depth arg. Also, found a good SO post that covers this topic in greater depth Browse and display files in a git repo without cloning.
This seems to be the cheapest way in terms of download size to fetch some commit provided that you have "create reference" access right to remote repository. I ran in to this problem today, and have found a way to download archives for a specific commit. If you go to a repository on git. The bottom url is a google git mirror.
You will be able do download archives for specific commits from here. I was in the same need. I need to download a patch of a specific commit which I need to apply onto another branch. Just specify the sha-id which is just older than the required commit. It will give. In this case, if all you want is the diff, you can download it from the web frontend for the kernel repo at this url:. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?
Collectives on Stack Overflow. Learn more. How do I download a specific git commit from a repository? Ask Question. Asked 11 years, 2 months ago. Active 11 months ago. Viewed 39k times. Improve this question. You can limit the depth of the history while cloning :. Deleting the. Or if you want to reuse your current repo: Make the current commit the only initial commit in a Git repository?
You could set the GitHub repository to be a template by going to settings and selecting the option just under the repository name. A button saying "Use this template" will then appear on the Code page.
This copies over all the files but removes all history and if you keep the original repo as private, this doesn't show any details under the repo name note that it will show on your site as you own both but not to anyone else. It's only if the repo is public that a link to the original repo appears under the repo name. Firstly, I should say that if there are only a few commits containing sensitive information, you'd be better to use git rebase -i to remove them.
But that can get complicated when those files have been touched frequently. Also, it's very hard to get rid of the initial commit using git-rebase , so if your initial commit contains the things you want to delete, then things get harder. But anyway, all of the answers above to fold the entire repo into one commit seem overly complicated, and will also be quite slow involving lots of intermediate directories and possibly trashing all the other configuration stored in.
A far quicker approach is to create an orphaned commit that exactly matches an existing commit, for example:. Replace master and truncated-master as appropriate, and change the commit message as you see fit. If you're feeling really brave, go ahead and:. But, I would really avoid doing this last step if I were you, as it will cause problems for every other person currently using the repo. Instead, just switch to using this new branch maybe with a better name and don't publicise the old one.
Isn't this exactly what squashing a rebase does? Just squash everything except the last commit and then force push it. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Questions: I cloned an empty repository from a personal git server.
After initial push push -u origin master I got some error but I pushed inside. Trying to use git push displays the following: No r Add menu. How to check if the revision commit exists in a remote Git repository Posted by: admin November 20, Leave a comment.
0コメント