Re: [linux] git pull vs svn up
To "throw away modifications in your sandbox" you don't have to git pull (or git fetch, as I prefer to do). You can: git reset --hard HEAD It will make your workspace match the HEAD commit on the current branch. It will not remove files that are not being tracked. For that you need git clean At this point, you still need to git pull (or git fetch git rebase remote-tracking-branch as I prefer) to get the remote changes. bjb On Sat, Jul 13, 2019 at 10:14:41AM -0400, Robert P. J. Day wrote: > 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+unsubscr...@linux-ottawa.org > To get help send a blank message to linux+h...@linux-ottawa.org > To visit the archives: https://lists.linux-ottawa.org > ---end quoted text--- To unsubscribe send a blank message to linux+unsubscr...@linux-ottawa.org To get help send a blank message to linux+h...@linux-ottawa.org To visit the archives: https://lists.linux-ottawa.org
Re: [linux] 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+unsubscr...@linux-ottawa.org To get help send a blank message to linux+h...@linux-ottawa.org To visit the archives: https://lists.linux-ottawa.org
Re: [linux] git pull vs svn up
Yes local delete (with or without commit), likely via GUI tools and fumble fingers. JN On 2019-07-13 9:34 a.m., Robert P. J. Day wrote: > 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? > > "git pull" will do two things: > > 1) fetch new content from the upstream, then > 2) *attempt* to merge that new content into your master branch >(assuming it's your master branch you're working with) > > are you asking about files you've renamed or deleted locally, and > committed locally as well? > > rday > To unsubscribe send a blank message to linux+unsubscr...@linux-ottawa.org To get help send a blank message to linux+h...@linux-ottawa.org To visit the archives: https://lists.linux-ottawa.org
Re: [linux] 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? "git pull" will do two things: 1) fetch new content from the upstream, then 2) *attempt* to merge that new content into your master branch (assuming it's your master branch you're working with) are you asking about files you've renamed or deleted locally, and committed locally as well? 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+unsubscr...@linux-ottawa.org To get help send a blank message to linux+h...@linux-ottawa.org To visit the archives: https://lists.linux-ottawa.org
[linux] git pull vs svn up
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? As far as I can determine, svn up will restore such files, but so far I've not found the equivalent git command. Do I need to "git checkout filename" for each of the lost files? I'm asking so I can avoid messing up repos, not to excite git vs. svn noise. JN To unsubscribe send a blank message to linux+unsubscr...@linux-ottawa.org To get help send a blank message to linux+h...@linux-ottawa.org To visit the archives: https://lists.linux-ottawa.org