Our company decided to move to Stash this week from github. We created all bare repos in stash for the ones in github.
Everything was pushed fine to stash after following the procedure mentioned in the docs here: https://confluence.atlassian.com/display/STASH/Importing+code+from+an+existing+project#Importingcodefromanexistingproject-ImportanexistingGitprojectintoStash
Except for one repo- the release team accidentally created a 'Readme' file on master branch inside the bare repo in stash.
So we removed that 'Readme' file , made a commit to that master in stash remote.
When we tried `git push --all stash` where stash is the name of the remote of stash repo, added to github repo cloned locally. (just like mentioned in the docs above ), it obviously didnt push to master as expected.
It says we need to update master with changes in remote. Use git pull.
Doing a git pull from github remote master branch, that has like 700 commits, it applies each patch, so there are conflicts after each patch.
Solving each conflict and then rebase --continue is really tiresome.
at this point im not sure what exactly to do now.
The situation can be summed up :
Any suggestions /help appreciated. ;((
I would do the merge manually to "throw away" the content of the README that you don't want. I believe that would look like this:
git fetch --all # Make sure you have up-to-date info git reset --hard origin/master # Start from what was on github git merge -s ours stash/master # Create a merge that ignores stash's changes git push stash master # Pushes up that merge commit
The drawback is that this extra commit will be in your history forever, but the good news is that nobody gets hurt. If you want to live a little bit more dangerously, you can simply overwrite the master using a forced push. There are some nasty consequences to trying to rewrite history like this, but if nobody else has tried to use the repository from stash yet, then you should be okay:
git fetch --all # Make sure you have up-to-date info git reset --hard origin/master # Start from what was on github git push -f stash master # Force push the master branch to stash
You should then restrict forced pushes to administrators, if you haven't already done so.
Thanks it worked :). First solution worked right away, though second would work too but we have read/write restrictions on rewriting history from admins.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If the repo on Stash contains nothing but those two commits, which you don't really want, couldn't you just delete the repo and recreate it empty?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.