0

So in their inifinite wisdom my work has moved everything to secured servers that do not connect to the internet and I had to move my projects to the servers to access data via virtual desktop.

This of course causes some issues with pushing to Github.

I had hoped I could copy and paste my git folders to my personal desktop and commit/push from there intermittently but it seems I am getting errors when I do so... It seems to think these were created in a different repo?

$git commit -am 'Push new stuff'
$git push origin master

To https:xxxxxxxx.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https:xxxxxxxxxx.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushin
hint: to the same ref. You may want to first merge the remote changes (e.g.
hint: 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Any advice on a way to get this process to work?

tshepang
  • 12,111
  • 21
  • 91
  • 136
Dirk Calloway
  • 2,569
  • 4
  • 23
  • 34

1 Answers1

0

If your commits are actually further ahead than those on GitHub (though have some kind of different branching along the way), you could move your current work to another branch, then pull what's available on GitHub, then re-merge the two branches to resolve the conflict.

git checkout master  // logical first step
git branch merger    // move current work to a merger branch
git pull origin      // update current branch to reflect GitHub repo
git merge merger     // merge with current work, resolving conflicts as needed
git commit origin    // push updated work back to GitHub
Nightfirecat
  • 11,432
  • 6
  • 35
  • 51
  • Thanks, yeah I tried to push the new stuff to a new branch but got the following....$ git push origin colt Password for 'https:xxxxxxxxxxxxxxxxx@bitbucket.org': error: src refspec colt does not match any. error: failed to push some refs to 'https:xxxxxxx.git' – Dirk Calloway Nov 18 '13 at 15:53
  • Perhaps [take a look at this question/answers](http://stackoverflow.com/questions/4181861/src-refspec-master-does-not-match-any-when-pushing-commits-in-git) regarding the respec error. – Nightfirecat Nov 18 '13 at 23:40