Git Error When Pushing to GitHub -


i'm new git, sourcetree, , version control in general please forgive ignorance.

i had project on github couple dozen commits master branch, never made other branches there commits master , nothing else.

using sourcetree, pulled down project , checked out older version of project intending work on version , discard of newer commits.

at point, project branches enter image description here work on older version of project little bit , go commit work. commit goes smoothly when go push project github server shows error message enter image description here says head detached hash. mean , how fix it? dialog box pushed from. enter image description here

thank time looking @ this.

edit: i'm wanting push master branch, while duplicate question wanting else detached head.

you've made commit detached head means don't have branch refers head, not allowed push github. commit should in master.

so should do:

0) open bash , go project directory.

1) stash uncommitted changes keep safe.

git stash 

2) rebase commits onto master.

git rebase master 

3) resolve conflicts if have it.

4) push changes.

git push 

5) stashed uncommitted changes.

git stash pop 

all information git can find in pro git


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -