Linked Questions
11 questions linked to/from How to push a shallow clone to a new repo?
392 votes
8 answers
256k views
Copy a git repo without history
I have a private repository on GitHub that I want to make public. However, some of the initial commits contain information that I don't want to publicize (hard-coded credentials, etc). What is the ...
277 votes
10 answers
137k views
Remote rejected (shallow update not allowed) after changing Git remote URL
I have a project under Git version control that I worked on both a server and my local computer. I originally had the remote origin set as my local computer but I would now like to change that to ...
16 votes
3 answers
11k views
git 'did not receive expected object' error when trying to update GitHub repo
I have a personal GitHub Pages set up for a blog, using Pelican. It was working ok, but I decided to start fresh with the content, and instead of cloning from the remote repo, I just started ...
6 votes
4 answers
13k views
Git - remove all history prior to a specific commit
I use git for various projects (personal repositories only), and I want to do some housekeeping. I have a downloaded git project tree that has a large history of commits. After downloading I made a ...
2 votes
2 answers
4k views
Push git to remote (Github) only one last commit, without history?
I'd like to push my project and share the repo on Github and my coworkers. But I have one problem, while I'm developing the project I committed some private stuff e.g. passwords to the git, so I don't ...
2 votes
1 answer
423 views
While mirroring to AWS CodeCommit error Unknown commit
I am tying to push the current branch from azure devOps (using ADO pipeline) to AWS CodeCommit repository. This code CommitCommit repository is freshly created and has no branches/commits/tags in it. ...
0 votes
0 answers
405 views
Mirror Git push without history of commits
I'm configuring BitBucket pipelines to mirror the repository to Github: clone: depth: full pipelines: default: - step: script: - git push --mirror [email protected]:MyOrg/mirror-...
0 votes
1 answer
384 views
Is there a way to do a git push --mirror on a shallow clone?
I am trying to do a shallow clone on a large repo and push it to a new destination. I have done a shallow clone using: git clone --depth 100 URL but when I try to push it using: git push --mirror URL ...
1 vote
1 answer
81 views
Git - checking out more files than in repository
We're migrating our repos from TFS to Git and for one of our repos, the clone process and checking out on the build machine says it's receiving objects and shows a count of 30,000. Our repo only has ...
1 vote
1 answer
158 views
Is it possible to host a shallow git repository (e. g. GitLab, GitHub, …)?
I want to make a git repository public, but without including all of the history in the public version. The git documentation seems to suggest git checkout --orphan as a potential solution to this: ...
1 vote
1 answer
105 views
How to create and apply git patches between two identical repos with mismatching commit IDs
I shallow-cloned a git repo from GitHub and moved it to an isolated private gitlab server. In order to push the shallow clone to the new repo, I had to lose the commit IDs and tags (I used this answer:...