Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am new to git, and I am working on a project with a friend, and somewhere something went wrong, and I cannot fix it.

The state now is that I have a working copy on my computer, but when I run git pull or git fetch and then git merge I get the output Already up-to-date.. On the other hand when I make a new directory, and run a git clone ... .. I get a broken copy of the project. I have checked out branchings but I have only one master branch. Here are some commands so you may spot what I am missing.

$ git branch
* master
$ git pull
Password: 
Already up-to-date.
$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 2 commits.
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   .DS_Store
nothing added to commit but untracked files present (use "git add" to track)
$ 

Here is a branching image from bitbucket: enter image description here

What I want to do is either uploading what I have, and run over everything on the server. Or merger 20bc5e1 with e5dd998.

I have tried this:

$ git branch friend 20bc5e1
$ git branch
* master
  friend
$ git merge friend
Already up-to-date.

So I had no success with this.

Edit

After some head banging, I made the most simple thing: I inserted a new trivial change (added a letter in a comment), and then committed, then pushed. And something wired happened, when I opened a new folder and cloned the project again, I got back the latest working version. But when I checked that comment, the new letter was not there. Its simple one commit behind. How can I fix this?

share|improve this question
    
Did you do a "git push --force" at any point? Because it seems 1d9 completely replaced 20b. I would make a branch on e5d (current top master), reset master to origin/master (20b), and merge. Then push, and check that the other developer get back your work. –  VonC Jan 6 '13 at 13:06
    
No I didn't do that. But after some thinking I remember having a conflict that I resolved. I was the 1d9 push where I did that. This explains some of my confusion. –  Martin Jan 7 '13 at 7:20
    
I would still recommend a reset, re-applying your work on top of that reset. –  VonC Jan 7 '13 at 8:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.