Re: help with git usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 29 Apr 2008, Daniel Quinlan wrote:

> I've been trying to use git for awhile now, (and I've read a lot of
> documentation, though maybe my
> comprehension has not been high enough) but there are several operations which
> I
> can't figure out:
> 
> 1) After cloning a repository from work at home, making some changes and
> committing them,
> I use "git push" to push them back to the work repository.  The changes seem
> to make it to the
> work repository (I see the commit message in git log), but I can't figure out
> how to get the
> changes into the working set at work.  (evidently not merge, checkout or reset
> -- seems like it
> should be merge, but)

You shouldn't push to a non-bare repository. You should, instead, set up a 
bare repository for publishing your changes, and have all of the 
repositories you work in be clones of that. The issue is that git doesn't 
expect something outside of the repository to change the current branch 
(much like CVS doesn't expect something else to update CVS/Entries in your 
working directory). Another alternative is, from home, to do:

$ git push origin refs/heads/*:refs/remotes/home/*

Then, at work, you can do:

$ git merge home/master

> 2) I can't figure out how to get back the latest (or any other) version of a
> file I've modified (or deleted)
> in the working set.  (Well, I suppose I could checkout the whole tree
> somewhere else and copy the
> relevant file, but I'm hoping there's something simpler).

$ git checkout HEAD -- <filename>

(And you can use any commit instead of HEAD to get other versions)

> 3) Similarly, I can't use the little context diffs I can see in git-gui  -- I
> need to see side by side comparisons;
> I've become accustomed to tkdiff.  It seems like git mergetool knows how to do
> that in some restricted
> circumstances, but I want to do it outside the context of a merge.

This I don't know, but you can get particular files from particular 
commits output with "git show <commit>:<path>", and you can likely wire 
something up.

	-Daniel
*This .sig left intentionally blank*
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux