Problem with git push
.
#158
Replies: 4 comments 4 replies
-
@julien-boudry Here are the first few lines of my
|
Beta Was this translation helpful? Give feedback.
-
At the end, will make some rebasing before merging. So if the history is actually ugly, it's not matter. |
Beta Was this translation helpful? Give feedback.
-
Unfortunate that you couldn't get back to me, but I understand that it is very late in your time zone. I had to figure it out for myself. Edit: Sorry. I did this before you replied. I figured that you must have gone to sleep for the night. I did I can't find any writing that gives a serious answer to how to reattach the HEAD. The best I can find was to do
What!? 32 commits? What happened? Did it duplicate them? I don't know where I even begin to resolve this one. All I can think of is to delete this local branch, & then recreate it from the remote branch. |
Beta Was this translation helpful? Give feedback.
-
So everything appears to be fine now; mostly. I did But there's one small thing that's off. I originally placed |
Beta Was this translation helpful? Give feedback.
-
Hello. I'm in a bad situation right now with git. I want to push my latest commits for the
Experimental/Schulze-STV
branch of Condorcet. This included a merge commit and more. My branch should be up to date, as I didgit pull
earlier, & the latest commit on the remote branch is from me. But I ran into some problems, and I think I messed things up trying to solve it.I did
git push origin
. It output:I wasn't sure why this is, as my local branch is called
Experimental/Schulze-STV
, just like the remote one. I have pushed from it before.I tried to find out how to set my branch to the remote branch. I found a page on Stack Overflow that said that I should enter
git checkout Experimental/Schulze-STV
. Here was the output:Oh no! I didn't expect it to overwrite my current local branch with another of the same name, but without the latest commits.
I found another page on Stack Overflow that said I should do
git cherry-pick e96c793c
(the name of my most recent commit) in this case. But it turns out it didn't do what I wanted. I want to just get all my commits back without making a new one, not to do a merge commit with integrating some changes to the current local branch. So it gave me some edits to my files with the HEAD vs commit e96c793 on various lines for me to decide which ones I wanted. But I already did this earlier, so I shouldn't have to do this again.So I tried doing
git branch Schulze-STV e96c793c
to see if I can get back to where I was before making that mistake. But it didn't. I didgit log
in that branch, & I don't see my latest commits.Fortunately, I can still see my latest commits in
git reflog
. But I don't know how to get them back.I went back to my branch
Experimental/Schulze-STV
to do agit reset --hard
& get rid of those merge stuff in the files.Would you be able to quickly give me guidance on how to fix this? You would need to respond quickly, as I'm going away tomorrow.
Beta Was this translation helpful? Give feedback.
All reactions