title: Git initial push fails pre-receive hook declined
body: <p>I pulled a repository and <strong>cleaned irrelevant parts</strong>. Locally everything is perfect. I want to keep history from previous repo.</p>
  
  <p>Then I created another repository, a clean one. But push is failing due to <code>pre-receive hook declined</code></p>
  
  <p>I am quite sure I don't have that kind of stuff on my repository :)</p>
  
  <p>I tried with several commands like --force-with-lease, without a luck.</p>
  
  <p>What can be the problem here, Is there something wrong with previous repository that I pulled from. </p>
  
  <pre><code>git push --verbose --set-upstream origin Last-backup:pushed-from-different-repo --force-with-lease
  Pushing to git@gitlab.localhost:tkcn/history-recovery.git
  Enter passphrase for key '---/.ssh/id_rsa':
  Counting objects: 415402, done.
  Delta compression using up to 8 threads.
  Compressing objects: 100% (129955/129955), done.
  Writing objects: 100% (415402/415402), 78.71 MiB | 271.00 KiB/s, done.
  Total 415402 (delta 229277), reused 411834 (delta 226634)
  remote: Resolving deltas: 100% (229277/229277), done.
  remote: Checking connectivity: 415402, done.
  remote: GitLab: Push operation timed out
  remote:
  remote: Timing information for debugging purposes:
  remote: Running checks for ref: pushed-from-different-repo
  remote: Checking if you are allowed to push... (5.83ms)
  remote: Checking if default branch is being deleted... (0.12ms)
  remote: Scanning repository for blobs stored in LFS and verifying their files have been uploaded to GitLab... (25.63ms)
  remote: Checking if branch follows the naming patterns defined by the project... (3.38ms)
  remote: Validating diff contents... (cancelled after 41262.16ms)
  To gitlab.localhost:tkcn/history-recovery.git
   ! [remote rejected]       Last-backup -&gt; pushed-from-different-repo (pre-receive hook declined)
  error: failed to push some refs to 'git@gitlab.localhost:tkcn/history-recovery.git'
  </code></pre>
  
  <p>git subtree split and git filter-branch --prune-empty didn't worked since the folders moved several times in the history.</p>
  
  <p>Most suitable solution on stackoverflow looks like <a href="https://stackoverflow.com/a/14764368/559873">https://stackoverflow.com/a/14764368/559873</a>
  However I am unable to run this on my windows machine. </p>