Hi! Git reset is a good thing. It is "git pull URL branch" here that is wrong.
The correct pull command will be "git pull" or "git pull origin", but not "git pull URL" that is currently used. I think the way to go is "git fetch" + "git reset". My idea is to 1. Update refs/remotes/origin/<branchname> to point to tip of remote branch. This is what "git fetch" does. (git pull also does that as it is actually a combination of "git fetch" + "git merge") 2. Align local branch with remote one. This is done by "git reset --hard". I think that this is the fastest way. We do not need the "merge" part of git pull, as we do not do any local development and do not need to keep any local changes. Also there can be a situation when remote branch proceeds in a non-trivial way, e.g. is reset to some historic revision, or is rebased completely rewriting the history. I think that "git merge" wouldn't be able to deal with that (as it tries to apply the changes to local branch, and this local branch can be irrelevant here), but I expect that "git fetch" + "git reset --hard" will be able to deal with it. 3. I have never worked with "git submodule" command. I see that it does not hurt, it is noop for projects that do not use git modules. I wonder whether we have a project using this feature. 2016-04-20 22:36 GMT+03:00 William Barker <[email protected]>: > +1 to removing the reset. The idea was to let Gump recover when Git thinks > the local copy was modifed. But this goes too much against Git's view of > things. I can't see anything better than the old fashioned rm -rf > > On Wednesday, April 20, 2016, Stefan Bodewig <[email protected]> wrote: > >> On 2016-04-20, Rainer Jung wrote: >> >> > What was the reason for the hard reset and could we remove it until a >> > better solution is found? >> >> I think the reason has been git not picking up the effect of changes to >> .gitattributes - I'm not convinced the reset helps without removing the >> index first anyway. >> >> Removing the reset is trivial :-) >> >> Stefan >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] <javascript:;> >> For additional commands, e-mail: [email protected] >> <javascript:;> >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
