What's the right way to force a get of a particular file? With cvs, you can just remove the file and do 'cvs update foo.c', but I'm having trouble RTF git M, and the otherwise helpful http://wiki.winehq.org/GitWine doesn't seem to mention this case.
(Every so often, it seems like git fetch doesn't get me the latest version of a few files. git diff shows no differences. I assume this is because I've manually patched a file or something, but it'd be nice to know how to deal with this other than throwing away the whole git tree and re-cloning. ) - Dan
Actually i use cg-restore from the cogito suite (can be mostly used parallel with git). It's a quite big shell script which call more than one git function)
cg-diff with colors is nice too... or cg-log -s (shows log similar to web based shortlog git viewer)
I hope this helps..
"Dan Kegel" dank@kegel.com writes:
What's the right way to force a get of a particular file? With cvs, you can just remove the file and do 'cvs update foo.c', but I'm having trouble RTF git M, and the otherwise helpful http://wiki.winehq.org/GitWine doesn't seem to mention this case.
git checkout foo.c
On 7/10/06, Alexandre Julliard julliard@winehq.org wrote:
"Dan Kegel" dank@kegel.com writes:
What's the right way to force a get of a particular file? With cvs, you can just remove the file and do 'cvs update foo.c', but I'm having trouble RTF git M, and the otherwise helpful http://wiki.winehq.org/GitWine doesn't seem to mention this case.
git checkout foo.c
That doesn't seem to do it for me.
Sigh, I guess I'll just have to keep blowing away my git tree every few days... shame I'm not smart enough to use 'git fetch' properly. - Dan
Dan Kegel wrote:
Sigh, I guess I'll just have to keep blowing away my git tree every few days... shame I'm not smart enough to use 'git fetch' properly.
Well, if you want to do it in a bit of a round about way:
git diff-index -p HEAD > foo.diff patch -p1 -R < foo.diff vi foo.diff #remove bits you don't want patch -p1 < foo.diff
I find the above useful for getting rid of things like whitespace changes or debugging messages I've added when preparing to commit something to my tree.
Mike
On 7/11/06, Mike McCormack mike@codeweavers.com wrote:
Sigh, I guess I'll just have to keep blowing away my git tree every few days... shame I'm not smart enough to use 'git fetch' properly.
Well, if you want to do it in a bit of a round about way:
git diff-index -p HEAD > foo.diff
/me goes off to read up on the -index commands, which are news to me.
Dan Kegel wrote:
git diff-index -p HEAD > foo.diff
/me goes off to read up on the -index commands, which are news to me.
You've probably figured it out already, but for anybody else...
The git "index" can be thought of as a record of what's checked out, or the thing you're about to commit. If the index is the same as the HEAD branch, you won't commit any changes when you run "git commit". If it's different, you will commit changes. "git status" gives a nice summary of that.
You change the git index with "git update-index". eg.
git update-index --add foo.c # add foo.c to the index git update-index --remove foo.c # remove foo.c from the index git update-index foo.c # add changes in foo.c to the index
You can collect changes that you plan to commit one by one with that command. If you decide you no longer want to commit them "git reset" will reset the index back to HEAD without changing the checked out files themselves.
You can compare the index to HEAD with the following command, as I mentioned:
git diff-index -p HEAD
Mike
On Wed, 12 Jul 2006, Mike McCormack wrote: [...]
You can compare the index to HEAD with the following command, as I mentioned:
git diff-index -p HEAD
Actually this command will show a diff of both files that are in the index and files that are NOT in the index. If all you are interested in is what's in the index, then you can use the following command (discovered by Huw):
git diff-index --cached -p HEAD
On Wednesday 12 July 2006 14:47, Dan Kegel wrote:
Sigh, I guess I'll just have to keep blowing away my git tree every few days... shame I'm not smart enough to use 'git fetch' properly.
- Dan
From the bottom of http://wiki.winehq.org/GitWine:
If you have made changes in the working copy but need to revert it to what is in the repository (equivalent to svn revert):
git checkout HEAD file-name