Re: [git-users] Struggling with cleanly "resetting" a local repo
On 2016-10-25, at 2:11 PM, David Karr wrote: > When I first cloned a remote repo, it had several subdirectories, and I had > Eclipse create projects automatically. > > Since that time, all but one of those subdirectories have been removed from > master. > > I want to just reset my local repo to match the remote, but try as I might, > it just is not removing those leftover peer subdirectories (and contents) > that are now removed from master on the remote. > > I've tried "git pull", "git pull -f", and "git reset --hard" both from the > command line and from Eclipse. The phantom directories are not removed. > > I know I could just nuke my local repo and reclone from the remote repo, but > I do have some stashes that I'd like to preserve for now. > > What else do I have to do to clean up these phantoms? You might try the following: 1. Delete local copies of all files that git is paying attention to. Leave the .git folder and all the git objects (this is where the stashes are kept). 2. Check out a fresh copy of the branch you want to work with. If I understand the situation correctly, that should make your workspace match what you want. > > -- > You received this message because you are subscribed to the Google Groups > "Git for human beings" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to git-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. --- Entertaining minecraft videos http://YouTube.com/keybounce -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [git-users] Try as I might, I just don't understand git. Can anyone please help me out?
Hey, thanks for your reply. I'll try to put up the error from my Stack Overflow questions, but I might not be able to remember them all verbatim. My answers in green below. - Got error saying I was on the wrong branch, when I wasn't (this just after a `git commit` command on a new branch). Error I got read something like: Execution of target "commit" failed for the following reason: You are not on the correct branch. "As commits are snapshots of the whole “project” you can not pull changes to only a set of files; you will get everything." The project I am working on has about 30 sites (Drupal sub sites) with thousands of files. So you're saying, if I need to work on 1 changed file I will have to pull all these others? What do you mean “kicked out”? As Git does not have access control built in, it cannot deny you from accessing a branch. Again, it would be helpful to see an error message This happens after I get a merge error. I fix it, and then go to commit again but get the error: "You are not on the correct branch."Using git branch reveals I am no longer on my branch. If I try to switch back to my branch I get an error saying something like "Please, commit your changes or stash them before you can switch branches." git-merge output will not necessarily show you which files have conflicts (although it is possible to parse it by eye). If you need such information, use git status. > > > This does still happen when I use 'git status' Sorry if this isnt really enough information. I'm really not sure what's going on. On Tuesday, October 25, 2016 at 5:32:40 PM UTC+10, Gergely Polonkai wrote: > > > > On Tue, Oct 25, 2016, 07:53 AD S > > wrote: > >> Honestly I must have watched hours of videos and completed 4 or 5 online >> tutorials and it's still not clicking. >> > > Could you show us which ones? The errors > >> >> I understand the concept: that git is a sub-versioning tool. It makes >> sense. I know why one would use it. >> > > Let's just call it Version Control System. subversion is another tool with > the same purpose. > >> >> But every time I try to use it something just breaks or goes wrong or >> blows up. >> >> This has happened just this week, for example: >> >> >>- Got error saying I was on the wrong branch, when I wasn't (this >>just after a `git commit` command on a new branch). >> >> git never says you are on a wrong branch. Could you show us the exact > error message ? > >> >>- After a being able to commit and push to github all last week, I >>randomly got a 'Connection refused' message (github.com was still up). >> >> There are tons of reasons that can lead to such an error message, most of > them being related to network issues, not Git. > >> >>- Went to pull 7 files from a branch but for some reason, this time, >>it pulled hundreds of files from the whole, broader project. >> >> As commits are snapshots of the whole “project”, you can not pull changes > to only a set of files; you will get everything. > >> >>- A few times I got kicked out of the branch after a failed commit >>and wouldn't let me return to branch because I had files waiting to be >>committed. Only way was to hard reset. >> >> What do you mean “kicked out”? As Git does not have access control built > in, it cannot deny you from accessing a branch. Again, it would be helpful > to see an error message . > >> >>- Saying there are merge conflict issues, but not showing what files >>there are on. >> >> git-merge output will not necessarily show you which files have conflicts > (although it is possible to parse it by eye). If you need such information, > use git status. > >> >>- Files that were tracked randomly become un-tracked. >> >> That means they were removed from tracking either by you or by someone > else, e.g. with git-rm > > These are a few, but in reality many similar problems happen throughout >> the day which really impacts my productivity. When I started, and studied, >> git I thought it would be pretty straight forward: pull the files you want >> to work on, make changes, push them and if there is a conflict error fix >> it. But it's complexity is beyond me. >> >> So, am I just cursed? What am I missing here? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Git for human beings" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to git-users+...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [git-users] Struggling with cleanly "resetting" a local repo
On Tuesday, October 25, 2016 at 2:15:24 PM UTC-7, Brendan Leber wrote: > > I would use "git clean --interactive" to remove dead files and > directories from my local repository. > Curiously, this finds leftover files below the directory that still remains in the remote repo, but it still ignored the several leftover peer directories that I'm referring to here. > B > > On Tue, Oct 25, 2016 at 2:11 PM, David Karr > wrote: > > When I first cloned a remote repo, it had several subdirectories, and I > had > > Eclipse create projects automatically. > > > > Since that time, all but one of those subdirectories have been removed > from > > master. > > > > I want to just reset my local repo to match the remote, but try as I > might, > > it just is not removing those leftover peer subdirectories (and > contents) > > that are now removed from master on the remote. > > > > I've tried "git pull", "git pull -f", and "git reset --hard" both from > the > > command line and from Eclipse. The phantom directories are not removed. > > > > I know I could just nuke my local repo and reclone from the remote repo, > but > > I do have some stashes that I'd like to preserve for now. > > > > What else do I have to do to clean up these phantoms? > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "Git for human beings" group. > > To unsubscribe from this group and stop receiving emails from it, send > an > > email to git-users+...@googlegroups.com . > > For more options, visit https://groups.google.com/d/optout. > > > > -- > C++ tries to guard against Murphy, not Machiavelli. - Damian Conway > -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [git-users] Struggling with cleanly "resetting" a local repo
I would use "git clean --interactive" to remove dead files and directories from my local repository. B On Tue, Oct 25, 2016 at 2:11 PM, David Karr wrote: > When I first cloned a remote repo, it had several subdirectories, and I had > Eclipse create projects automatically. > > Since that time, all but one of those subdirectories have been removed from > master. > > I want to just reset my local repo to match the remote, but try as I might, > it just is not removing those leftover peer subdirectories (and contents) > that are now removed from master on the remote. > > I've tried "git pull", "git pull -f", and "git reset --hard" both from the > command line and from Eclipse. The phantom directories are not removed. > > I know I could just nuke my local repo and reclone from the remote repo, but > I do have some stashes that I'd like to preserve for now. > > What else do I have to do to clean up these phantoms? > > -- > You received this message because you are subscribed to the Google Groups > "Git for human beings" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to git-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- C++ tries to guard against Murphy, not Machiavelli. - Damian Conway -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[git-users] Struggling with cleanly "resetting" a local repo
When I first cloned a remote repo, it had several subdirectories, and I had Eclipse create projects automatically. Since that time, all but one of those subdirectories have been removed from master. I want to just reset my local repo to match the remote, but try as I might, it just is not removing those leftover peer subdirectories (and contents) that are now removed from master on the remote. I've tried "git pull", "git pull -f", and "git reset --hard" both from the command line and from Eclipse. The phantom directories are not removed. I know I could just nuke my local repo and reclone from the remote repo, but I do have some stashes that I'd like to preserve for now. What else do I have to do to clean up these phantoms? -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [git-users] Try as I might, I just don't understand git. Can anyone please help me out?
Have you read the pro git book? It's a really good and high quality book, it sure will be better than a tutorial. It goes from the basics to really deep subjects. El mar., 25 de oct. de 2016 a la(s) 04:32, Gergely Polonkai < gerg...@polonkai.eu> escribió: > > > On Tue, Oct 25, 2016, 07:53 AD S wrote: > > Honestly I must have watched hours of videos and completed 4 or 5 online > tutorials and it's still not clicking. > > > Could you show us which ones? The errors > > > I understand the concept: that git is a sub-versioning tool. It makes > sense. I know why one would use it. > > > Let's just call it Version Control System. subversion is another tool with > the same purpose. > > > But every time I try to use it something just breaks or goes wrong or > blows up. > > This has happened just this week, for example: > > >- Got error saying I was on the wrong branch, when I wasn't (this just >after a `git commit` command on a new branch). > > git never says you are on a wrong branch. Could you show us the exact > error message ? > > >- After a being able to commit and push to github all last week, I >randomly got a 'Connection refused' message (github.com was still up). > > There are tons of reasons that can lead to such an error message, most of > them being related to network issues, not Git. > > >- Went to pull 7 files from a branch but for some reason, this time, >it pulled hundreds of files from the whole, broader project. > > As commits are snapshots of the whole “project”, you can not pull changes > to only a set of files; you will get everything. > > >- A few times I got kicked out of the branch after a failed commit and >wouldn't let me return to branch because I had files waiting to be >committed. Only way was to hard reset. > > What do you mean “kicked out”? As Git does not have access control built > in, it cannot deny you from accessing a branch. Again, it would be helpful > to see an error message . > > >- Saying there are merge conflict issues, but not showing what files >there are on. > > git-merge output will not necessarily show you which files have conflicts > (although it is possible to parse it by eye). If you need such information, > use git status. > > >- Files that were tracked randomly become un-tracked. > > That means they were removed from tracking either by you or by someone > else, e.g. with git-rm > > These are a few, but in reality many similar problems happen throughout > the day which really impacts my productivity. When I started, and studied, > git I thought it would be pretty straight forward: pull the files you want > to work on, make changes, push them and if there is a conflict error fix > it. But it's complexity is beyond me. > > So, am I just cursed? What am I missing here? > > -- > You received this message because you are subscribed to the Google Groups > "Git for human beings" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to git-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "Git for human beings" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to git-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [git-users] Try as I might, I just don't understand git. Can anyone please help me out?
On Tue, Oct 25, 2016, 07:53 AD S wrote: Honestly I must have watched hours of videos and completed 4 or 5 online tutorials and it's still not clicking. Could you show us which ones? The errors I understand the concept: that git is a sub-versioning tool. It makes sense. I know why one would use it. Let's just call it Version Control System. subversion is another tool with the same purpose. But every time I try to use it something just breaks or goes wrong or blows up. This has happened just this week, for example: - Got error saying I was on the wrong branch, when I wasn't (this just after a `git commit` command on a new branch). git never says you are on a wrong branch. Could you show us the exact error message ? - After a being able to commit and push to github all last week, I randomly got a 'Connection refused' message (github.com was still up). There are tons of reasons that can lead to such an error message, most of them being related to network issues, not Git. - Went to pull 7 files from a branch but for some reason, this time, it pulled hundreds of files from the whole, broader project. As commits are snapshots of the whole “project”, you can not pull changes to only a set of files; you will get everything. - A few times I got kicked out of the branch after a failed commit and wouldn't let me return to branch because I had files waiting to be committed. Only way was to hard reset. What do you mean “kicked out”? As Git does not have access control built in, it cannot deny you from accessing a branch. Again, it would be helpful to see an error message . - Saying there are merge conflict issues, but not showing what files there are on. git-merge output will not necessarily show you which files have conflicts (although it is possible to parse it by eye). If you need such information, use git status. - Files that were tracked randomly become un-tracked. That means they were removed from tracking either by you or by someone else, e.g. with git-rm These are a few, but in reality many similar problems happen throughout the day which really impacts my productivity. When I started, and studied, git I thought it would be pretty straight forward: pull the files you want to work on, make changes, push them and if there is a conflict error fix it. But it's complexity is beyond me. So, am I just cursed? What am I missing here? -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.