I\'m a Git newbie. I recently moved a Rails project from Subversion to Git. I followed the tutorial here: http://www.simplisticcomplexity.com/2008/03/05/cleanly-migrate-yo
I am struggling with this problem and none of the previous answers tackle the question as I see it. I have stripped the problem back down to its basics to see if I can make my problem clear.
I create a new repository (rep1), put one file in it and commit it.
mkdir rep1
cd rep1
git init
echo "Line1" > README
git add README
git commit -m "Commit 1"
I create a clone of rep1 and call it rep2. I look inside rep2 and see the file is correct.
cd ~
git clone ~/rep1 rep2
cat ~/rep2/README
In rep1 I make a single change to the file and commit it. Then in rep1 I create a remote to point to rep2 and push the changes.
cd ~/rep1
git remote add rep2 ~/rep2
git push rep2 master
Now when I go into rep2 and do a 'git status' I get told I am ahead of origin.
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
# Changes to be committed:
# (use "git reset HEAD ..." to unstage)
#
# modified: README
#
README in rep2 is as it was originally, before the second commit. The only modifications I have done are to rep1 and all I wanted to do was push them out to rep2. What is it I am not grasping?