From: Jakub Narebski Date: Tue, 24 Oct 2006 10:13:38 GMT Subject: Re: updating only changed files source directory? Message-ID: <200610241213.38558.jnareb@gmail.com> In-Reply-To: <453DE1F5.5010803@xs4all.nl> Han-Wen Nienhuys wrote: > Jakub Narebski escreveu: >> Han-Wen Nienhuys wrote: >> >> I see that you are using fairly low level commands (plumbing commands) >> >>> git-http-fetch -a >>> wget /refs/head/ ## dump to /refs/head/ >> >> instead of setting $GIT_DIR/remotes/origin file and using "git fetch". >> BTW. "git fetch" will not update branch you are on, unless --update-head-ok >> option is used. > > I tried fetch, but was put off by the warnings because I didn't have > --update-head-ok. Using lowlevel commands is my way of making sure that > Git doesn't assume it needs to do anything intelligent. You can either have additional branch which is not tracking branch (you don't fetch into this branch), and on which you are always on, called for example 'check-out' (and which can be used for git-reset solution to checking out files to external directory), and use git-fetch without --update-head-ok, or (if the repository is bare repository, without working area) use --update-head-ok. >>> git --git-dir read-tree >>> >>> cd >>> git --git-dir checkout-index -a -f >> >> instead of >> git --git-dir= checkout >> (-f is Force a re-read of everything) git-checkout-index(1): -f|--force forces overwrite of existing files So probably you would get what you want if you lose '-f'. > Yes, however, > > git checkout > > changes the state of the repository, which is something I want to prevent. Well, git-reset also changes state of repository, but it changes only the branch we have created exactly for this purpose. -- Jakub Narebski Poland