home | list info | list archive | date index | thread index

Re: git pull vs svn up

On Sat, 13 Jul 2019, J C Nash wrote:

> For my own work I mostly use svn since I have it well-established on
> my uottawa VPS. However, I'm using gitlab for a project I share with
> others.
>
> Am I correct that
>
>   git pull
>
> will NOT restore files that have somehow been deleted or renamed?

  i'm not sure how to best clarify this, but git has a very different
model of committing changes in that, when you clone a git repo, you
get the *entire* history of the repo. what this means is that, as part
of a normal git workflow, since you have that entire history, you're
expected to fix any "oopses" *locally* -- perhaps with having made
your changes on a local branch, perhaps checking out a deleted file
from another branch that still contains the file, or perhaps doing a
"git reset --hard" or "git revert" to undo the effect of said
deletion.

  the git push/pull/fetch commands are most emphatically *not*
designed to fix oopses in your local repo -- they are meant for
exchanging new content between repositories. except in very rare
circumstances (total meltdown of local repo, for example), it is not
some other repository's responsibility to help you recover from
simple local mistakes like deleting a file.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                         http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

To unsubscribe send a blank message to linux+unsubscribe [ at ] linux-ottawa [ dot ] org
To get help send a blank message to linux+help [ at ] linux-ottawa [ dot ] org
To visit the archives: https://lists.linux-ottawa.org

replies

references

message navigation