I suck at getting uptodate prototype/master.

1 view
Skip to first unread message

Richard Quadling

unread,
Feb 25, 2009, 11:10:45 AM2/25/09
to prototy...@googlegroups.com
Hi.

I do the following steps ...

cd /d D:\Source\prototype
git pull

And get an error ...

Updating ab1313e..8bfd9cf
error: Entry 'src/dom/form.js' not uptodate. Cannot merge.

If I delete form.js, then pull works.

I'm used to using cvs update which simply merges all differences from
the main repository into my local copy.

Similarly for svn.

But git is different it seems.

Using git pull -v, I get ...

From git://github.com/sstephenson/prototype
= [up to date] caja -> origin/caja
= [up to date] experimental -> origin/experimental
= [up to date] integration -> origin/integration
= [up to date] layout -> origin/layout
= [up to date] master -> origin/master
= [up to date] rewrite -> origin/rewrite
= [up to date] sprockets -> origin/sprockets
Updating ab1313e..8bfd9cf
error: Entry 'src/dom/form.js' not uptodate. Cannot merge.

So, I know I suck at this, but any help would be appreciated.

Regards,

Richard Quadling.
--
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"

Mislav Marohnić

unread,
Feb 26, 2009, 7:54:09 AM2/26/09
to prototy...@googlegroups.com
Hey Richard,

A "git pull" command is a combo of "git fetch" and "git merge". The first command pulls objects (commits, etc.) from the repository that you don't have locally. It also updates your "remote" branches (origin/master, etc.).

After fetching, git notices you are currently on the "master" branch and wants to merge "origin/master" into it. This is called "tracking branch" -- "master" is set up to track "origin/master" by default whenever you clone a repository.

However, a git merge cannot succeed if the file that has changes to be merged also has uncommited changes in your working copy. You made local changes to "src/dom/form.js", but you didn't commit them. You can inspect that by typing "git status".

If you commited those changes to "master", the merge could proceed. However, there might be a conflict if the same lines of code were changed by you as well as upstream. You will then be prompted to resolve the conflicts by hand.

The "git stash" command can help in cases you're not ready to commit your changes, but want to pull from the repository anyway with your changes preserved afterwards:

  git stash
  git pull
  git stash pop

However, the best practice for experimenting with Prototype is to commit your changes to a separate branch, then when you wish to pull in the latest version of Prototype you just checkout "master" again and do a "git pull".

Now, if you want to update the "master" branch to the latest state as currently on github and you don't care about your changes made to the working copy, you can issue this command while on "master": "git fetch origin && git reset --hard origin/master". YOU WILL LOSE all changes (commited or uncommited) on this branch that are not a part of the master branch on github, but sometimes you want to use this destructive method simply to clean up some mess you have made on the branch by saying "get me the latest state of prototype library, period."

Richard Quadling

unread,
Feb 26, 2009, 8:51:00 AM2/26/09
to prototy...@googlegroups.com
2009/2/26 Mislav Marohnić <mislav....@gmail.com>:
Thank you. I didn't realise I'd edited the files locally. What a dope!

Ryan Angilly

unread,
Feb 26, 2009, 9:12:20 AM2/26/09
to prototy...@googlegroups.com
'git status' and 'git diff' are nice for seeing what's changed locally since the last pull/commit.  I run them all the time... sometimes without even thinking about it.

Richard Quadling

unread,
Feb 26, 2009, 10:07:19 AM2/26/09
to prototy...@googlegroups.com
2009/2/26 Ryan Angilly <ang...@gmail.com>:
More thank you.
Reply all
Reply to author
Forward
0 new messages