Apr. 20th, 2013

jbanana: Badly drawn banana (Default)
I cloned of a repo to a USB stick and took it away to make changes. Then I wanted to put the changes back:
$ cd <clonedgitrepo>

$ git push
<blah blah blah>
 ! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to '<remotegitrepo>'
Oh dear. But after some googling, I found I can do this:
$ cd <remotegitrepo>

$ git checkout --detach
<blah blah> 'detached HEAD' state <blah blah>

$ cd <clonedgitrepo>

$ git push
<blah blah blah - works>

$ cd <remotegitrepo>

$ git checkout master
<blah blah blah>
Success! Now to post this to DW so that I can find it again next time that happens...

August 2025

M T W T F S S
    123
45678910
11121314151617
1819202122 2324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 30th, 2025 10:14 pm
Powered by Dreamwidth Studios