On Tue, Feb 23, 2010 at 8:06 AM, harryos <[email protected]> wrote:
> I was going thru the git tutorials and tried this, > I created a repository on github and successfully added code to it. > Then I modified the code on my local machine and committed ,but didn't > add to github. > I wanted to discard my local changes and pull what exists at github > master. > So,I did this >>>git branch mywork >>>git pull git://github.com/myname/dummypythonprj.git master > > then,I got this reply > From git://github.com/myname/dummypythonprj > * branch master -> FETCH_HEAD > Already up-to-date. > > when I try gedit mycode.py (which is shown as the old file on github's > page ) I can only see the local coomitted new version,not the old. > > I am confused by this..I thought the pull would merge the version on > github into my local repository..Can someone please help me figure out > what I am doing wrong? `git-pull` is going to perform a `git-merge`, which tries to merge two histories - not overwrite one entirely. What you're looking for is `git-reset`: $ git fetch origin $ git reset --hard origin/master This pulls all objects from origin then resets the current branch to point to origin's "master" branch. That is, the version of "master" on GitHub. -- Chris Wanstrath http://github.com/defunkt -- You received this message because you are subscribed to the Google Groups "GitHub" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/github?hl=en.
