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:
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.
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?