{"thread":{"id":"50960","subject":"I messed up my own git tree and I don't know how to fix it.","startedAt":"2019-04-21T03:19:59Z","lastAt":"2019-04-21T21:18:04Z","messageCount":9,"participants":["rob","Adrian H","Philip Oakley","Andreas Schwab"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"374178","messageId":"cb1f725f-1314-d320-104a-726ef1c906fa@fastmail.com","threadId":"50960","inReplyTo":null,"subject":"I messed up my own git tree and I don't know how to fix it.","fromName":"rob","fromEmail":"drrob100@fastmail.com","sentAt":"2019-04-21T03:01:08Z","receivedAt":"2019-04-21T03:19:59Z","isPatch":false,"sender":{"key":"drrob100@fastmail.com","avatar":null},"body":"I have my own code at a github repository, using Go.  Part of using Go \nlibraries not part of the official Go people is by using a system they \ncall go get.  This essentially uses git to, well, go get source code.  \nMine are at github.com and golang.org.  My computer runs LinuxMint 19.1.\n\nI used goland IDE from jetbrains to run go fmt on my entire project.  \nNow I am getting this message that I cannot get rid of:\n\nchanges not staged for commit:\n\n   modified: github.com/alecthomas/gometalinter (modified content)\n\n   modified: github.com/kisielk/errcheck (modified content)\n\n   modified: github.com/rogpeppe/godef (modified content)\n\n\nI do not want any changes to central repos to be tracked or committed, \nbut I cannot undo this.  I tried, for example,\n\ngit checkout -- github.com/alecthomas/gometalinter\n\nI don't get an error message but it does not do anything.  The file is \nnot changes, and git status show me the same information, ie, these \nfiles have changes not staged for commit.\n\nI do not know how to restore these files to the state they were in in \nthe repo, and to have my own git tree not to flag this as an unstaged \nalteration.  Running rm -rfv on the repos on my computer, then running \ngo get to restore them does not change git status. It still sahs changes \nnot stated for commit: modified.\n\nThis happens for the above 3 tree items.\n\nHow do I restore these to the github remote repository condition and not \nhave my own git tree mark these as changed?\n\n--rob solomon\n\n"},{"id":"374181","messageId":"CAP_kE8XaFW=G1f_qrS2sEp+ELQ9otk=j0-ZtbF1dATQX8ZjrAA@mail.gmail.com","threadId":"50960","inReplyTo":"cb1f725f-1314-d320-104a-726ef1c906fa@fastmail.com","subject":"Re: I messed up my own git tree and I don't know how to fix it.","fromName":"Adrian H","fromEmail":"adrianh.bsc@gmail.com","sentAt":"2019-04-21T05:03:17Z","receivedAt":"2019-04-21T05:03:33Z","isPatch":false,"sender":{"key":"adrianh.bsc@gmail.com","avatar":null},"body":"If I understand the commands you are using correctly, you are\nreferencing the remote repo.  You need to reference the local repo.\nSo try using the following commands:\n\ngit checkout -- alecthomas/gometalinter\ngit checkout -- kisielk/errcheck\ngit checkout -- rogpeppe/godef\n\nOr if those are the only files that have been modified, then you can\nuse the following single command:\n\ngit reset --hard\n\nand that will reset all files that have not been staged.\n\nHTH\n\n\nA\n\n\nOn Sat, Apr 20, 2019 at 11:22 PM rob <drrob100@fastmail.com> wrote:\n>\n> I have my own code at a github repository, using Go.  Part of using Go\n> libraries not part of the official Go people is by using a system they\n> call go get.  This essentially uses git to, well, go get source code.\n> Mine are at github.com and golang.org.  My computer runs LinuxMint 19.1.\n>\n> I used goland IDE from jetbrains to run go fmt on my entire project.\n> Now I am getting this message that I cannot get rid of:\n>\n> changes not staged for commit:\n>\n>    modified: github.com/alecthomas/gometalinter (modified content)\n>\n>    modified: github.com/kisielk/errcheck (modified content)\n>\n>    modified: github.com/rogpeppe/godef (modified content)\n>\n>\n> I do not want any changes to central repos to be tracked or committed,\n> but I cannot undo this.  I tried, for example,\n>\n> git checkout -- github.com/alecthomas/gometalinter\n>\n> I don't get an error message but it does not do anything.  The file is\n> not changes, and git status show me the same information, ie, these\n> files have changes not staged for commit.\n>\n> I do not know how to restore these files to the state they were in in\n> the repo, and to have my own git tree not to flag this as an unstaged\n> alteration.  Running rm -rfv on the repos on my computer, then running\n> go get to restore them does not change git status. It still sahs changes\n> not stated for commit: modified.\n>\n> This happens for the above 3 tree items.\n>\n> How do I restore these to the github remote repository condition and not\n> have my own git tree mark these as changed?\n>\n> --rob solomon\n>\n\n\n-- \n========================================\n            Adrian Hawryluk\n         BSc. Computer Science\n----------------------------------------\n           Specialising in:\n        OOD Methodologies in UML\n  OOP Methodologies in C, C++ and more\n        RT Embedded Programming\n            GUI Development\n========================================\n"},{"id":"374194","messageId":"b0a8d228-78c5-a355-1ded-dc2904d8216e@fastmail.com","threadId":"50960","inReplyTo":"CAP_kE8XaFW=G1f_qrS2sEp+ELQ9otk=j0-ZtbF1dATQX8ZjrAA@mail.gmail.com","subject":"Re: I messed up my own git tree and I don't know how to fix it.","fromName":"rob","fromEmail":"drrob100@fastmail.com","sentAt":"2019-04-21T12:34:30Z","receivedAt":"2019-04-21T12:46:27Z","isPatch":false,"sender":{"key":"drrob100@fastmail.com","avatar":null},"body":"didn't work.  I did not get any error messages, just didn't work.  After \nI did\n\n   git reset --hard\n\n   git status\n\nI see the same 3 files that say changes not staged for commit: modified \nand it lists the same 3 files.\n\n--rob\n\n\nOn 4/21/19 1:03 AM, Adrian H wrote:\n> If I understand the commands you are using correctly, you are\n> referencing the remote repo.  You need to reference the local repo.\n> So try using the following commands:\n>\n> git checkout -- alecthomas/gometalinter\n> git checkout -- kisielk/errcheck\n> git checkout -- rogpeppe/godef\n>\n> Or if those are the only files that have been modified, then you can\n> use the following single command:\n>\n> git reset --hard\n>\n> and that will reset all files that have not been staged.\n>\n> HTH\n>\n>\n> A\n>\n>\n> On Sat, Apr 20, 2019 at 11:22 PM rob <drrob100@fastmail.com> wrote:\n>> I have my own code at a github repository, using Go.  Part of using Go\n>> libraries not part of the official Go people is by using a system they\n>> call go get.  This essentially uses git to, well, go get source code.\n>> Mine are at github.com and golang.org.  My computer runs LinuxMint 19.1.\n>>\n>> I used goland IDE from jetbrains to run go fmt on my entire project.\n>> Now I am getting this message that I cannot get rid of:\n>>\n>> changes not staged for commit:\n>>\n>>     modified: github.com/alecthomas/gometalinter (modified content)\n>>\n>>     modified: github.com/kisielk/errcheck (modified content)\n>>\n>>     modified: github.com/rogpeppe/godef (modified content)\n>>\n>>\n>> I do not want any changes to central repos to be tracked or committed,\n>> but I cannot undo this.  I tried, for example,\n>>\n>> git checkout -- github.com/alecthomas/gometalinter\n>>\n>> I don't get an error message but it does not do anything.  The file is\n>> not changes, and git status show me the same information, ie, these\n>> files have changes not staged for commit.\n>>\n>> I do not know how to restore these files to the state they were in in\n>> the repo, and to have my own git tree not to flag this as an unstaged\n>> alteration.  Running rm -rfv on the repos on my computer, then running\n>> go get to restore them does not change git status. It still sahs changes\n>> not stated for commit: modified.\n>>\n>> This happens for the above 3 tree items.\n>>\n>> How do I restore these to the github remote repository condition and not\n>> have my own git tree mark these as changed?\n>>\n>> --rob solomon\n>>\n>\n"},{"id":"374196","messageId":"4b388e60-703d-8ac3-ef74-211924374249@iee.org","threadId":"50960","inReplyTo":"b0a8d228-78c5-a355-1ded-dc2904d8216e@fastmail.com","subject":"Re: I messed up my own git tree and I don't know how to fix it.","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2019-04-21T13:03:50Z","receivedAt":"2019-04-21T13:03:56Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"Hi Rob,\n\nOn 21/04/2019 13:34, rob wrote:\n> didn't work.  I did not get any error messages, just didn't work.  \n> After I did\n>\n>   git reset --hard\n>\n>   git status\n>\n> I see the same 3 files that say changes not staged for commit: \n> modified and it lists the same 3 files.\nCould this be that the file timestamps are being changed in the \nbackground and git is detecting those timestamp changes, even when there \nis no change to the files.\n- Just as thought.\n\n(In-line posting is preferred, so as to see the replies in context)\nPhilip\n\n>\n> --rob\n>\n>\n> On 4/21/19 1:03 AM, Adrian H wrote:\n>> If I understand the commands you are using correctly, you are\n>> referencing the remote repo.  You need to reference the local repo.\n>> So try using the following commands:\n>>\n>> git checkout -- alecthomas/gometalinter\n>> git checkout -- kisielk/errcheck\n>> git checkout -- rogpeppe/godef\n>>\n>> Or if those are the only files that have been modified, then you can\n>> use the following single command:\n>>\n>> git reset --hard\n>>\n>> and that will reset all files that have not been staged.\n>>\n>> HTH\n>>\n>>\n>> A\n>>\n>>\n>> On Sat, Apr 20, 2019 at 11:22 PM rob <drrob100@fastmail.com> wrote:\n>>> I have my own code at a github repository, using Go.  Part of using Go\n>>> libraries not part of the official Go people is by using a system they\n>>> call go get.  This essentially uses git to, well, go get source code.\n>>> Mine are at github.com and golang.org.  My computer runs LinuxMint \n>>> 19.1.\n>>>\n>>> I used goland IDE from jetbrains to run go fmt on my entire project.\n>>> Now I am getting this message that I cannot get rid of:\n>>>\n>>> changes not staged for commit:\n>>>\n>>>     modified: github.com/alecthomas/gometalinter (modified content)\n>>>\n>>>     modified: github.com/kisielk/errcheck (modified content)\n>>>\n>>>     modified: github.com/rogpeppe/godef (modified content)\n>>>\n>>>\n>>> I do not want any changes to central repos to be tracked or committed,\n>>> but I cannot undo this.  I tried, for example,\n>>>\n>>> git checkout -- github.com/alecthomas/gometalinter\n>>>\n>>> I don't get an error message but it does not do anything.  The file is\n>>> not changes, and git status show me the same information, ie, these\n>>> files have changes not staged for commit.\n>>>\n>>> I do not know how to restore these files to the state they were in in\n>>> the repo, and to have my own git tree not to flag this as an unstaged\n>>> alteration.  Running rm -rfv on the repos on my computer, then running\n>>> go get to restore them does not change git status. It still sahs \n>>> changes\n>>> not stated for commit: modified.\n>>>\n>>> This happens for the above 3 tree items.\n>>>\n>>> How do I restore these to the github remote repository condition and \n>>> not\n>>> have my own git tree mark these as changed?\n>>>\n>>> --rob solomon\n>>>\n>>\n\n"},{"id":"374197","messageId":"87pnpfwlej.fsf@igel.home","threadId":"50960","inReplyTo":"cb1f725f-1314-d320-104a-726ef1c906fa@fastmail.com","subject":"Re: I messed up my own git tree and I don't know how to fix it.","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2019-04-21T13:14:12Z","receivedAt":"2019-04-21T13:14:18Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"On Apr 20 2019, rob <drrob100@fastmail.com> wrote:\n\n> changes not staged for commit:\n>\n>   modified: github.com/alecthomas/gometalinter (modified content)\n>\n>   modified: github.com/kisielk/errcheck (modified content)\n>\n>   modified: github.com/rogpeppe/godef (modified content)\n\nYou have submodules with modified content.  If you want to keep them you\nneed to create commits in each modified submodule, then add them to the\nsuperproject and commit there.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1\n\"And now for something completely different.\"\n"},{"id":"374201","messageId":"b05fee72-5536-65d5-1237-f4e5c83db9e8@fastmail.com","threadId":"50960","inReplyTo":"4b388e60-703d-8ac3-ef74-211924374249@iee.org","subject":"Re: I messed up my own git tree and I don't know how to fix it.","fromName":"rob","fromEmail":"drrob100@fastmail.com","sentAt":"2019-04-21T17:07:14Z","receivedAt":"2019-04-21T17:07:18Z","isPatch":false,"sender":{"key":"drrob100@fastmail.com","avatar":null},"body":"possibly.  What do I do about that?\n\n--rob\n\n\nOn 4/21/19 9:03 AM, Philip Oakley wrote:\n> Hi Rob,\n>\n> On 21/04/2019 13:34, rob wrote:\n>> didn't work.  I did not get any error messages, just didn't work.  \n>> After I did\n>>\n>>   git reset --hard\n>>\n>>   git status\n>>\n>> I see the same 3 files that say changes not staged for commit: \n>> modified and it lists the same 3 files.\n> Could this be that the file timestamps are being changed in the \n> background and git is detecting those timestamp changes, even when \n> there is no change to the files.\n> - Just as thought.\n>\n> (In-line posting is preferred, so as to see the replies in context)\n> Philip\n>\n>>\n>> --rob\n>>\n>>\n>> On 4/21/19 1:03 AM, Adrian H wrote:\n>>> If I understand the commands you are using correctly, you are\n>>> referencing the remote repo.  You need to reference the local repo.\n>>> So try using the following commands:\n>>>\n>>> git checkout -- alecthomas/gometalinter\n>>> git checkout -- kisielk/errcheck\n>>> git checkout -- rogpeppe/godef\n>>>\n>>> Or if those are the only files that have been modified, then you can\n>>> use the following single command:\n>>>\n>>> git reset --hard\n>>>\n>>> and that will reset all files that have not been staged.\n>>>\n>>> HTH\n>>>\n>>>\n>>> A\n>>>\n>>>\n>>> On Sat, Apr 20, 2019 at 11:22 PM rob <drrob100@fastmail.com> wrote:\n>>>> I have my own code at a github repository, using Go.  Part of using Go\n>>>> libraries not part of the official Go people is by using a system they\n>>>> call go get.  This essentially uses git to, well, go get source code.\n>>>> Mine are at github.com and golang.org.  My computer runs LinuxMint \n>>>> 19.1.\n>>>>\n>>>> I used goland IDE from jetbrains to run go fmt on my entire project.\n>>>> Now I am getting this message that I cannot get rid of:\n>>>>\n>>>> changes not staged for commit:\n>>>>\n>>>>     modified: github.com/alecthomas/gometalinter (modified content)\n>>>>\n>>>>     modified: github.com/kisielk/errcheck (modified content)\n>>>>\n>>>>     modified: github.com/rogpeppe/godef (modified content)\n>>>>\n>>>>\n>>>> I do not want any changes to central repos to be tracked or committed,\n>>>> but I cannot undo this.  I tried, for example,\n>>>>\n>>>> git checkout -- github.com/alecthomas/gometalinter\n>>>>\n>>>> I don't get an error message but it does not do anything. The file is\n>>>> not changes, and git status show me the same information, ie, these\n>>>> files have changes not staged for commit.\n>>>>\n>>>> I do not know how to restore these files to the state they were in in\n>>>> the repo, and to have my own git tree not to flag this as an unstaged\n>>>> alteration.  Running rm -rfv on the repos on my computer, then running\n>>>> go get to restore them does not change git status. It still sahs \n>>>> changes\n>>>> not stated for commit: modified.\n>>>>\n>>>> This happens for the above 3 tree items.\n>>>>\n>>>> How do I restore these to the github remote repository condition \n>>>> and not\n>>>> have my own git tree mark these as changed?\n>>>>\n>>>> --rob solomon\n>>>>\n>>>\n>\n"},{"id":"374202","messageId":"2f3dc6f3-cd6a-7079-d81f-66c101c98a64@iee.org","threadId":"50960","inReplyTo":"b05fee72-5536-65d5-1237-f4e5c83db9e8@fastmail.com","subject":"Re: I messed up my own git tree and I don't know how to fix it.","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2019-04-21T17:22:46Z","receivedAt":"2019-04-21T17:22:51Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"On 21/04/2019 18:07, rob wrote:\n> possibly. What do I do about that?\n>\n> --rob\n>\nsee below.\n>\n> On 4/21/19 9:03 AM, Philip Oakley wrote:\n>> Hi Rob,\n>>\n>> On 21/04/2019 13:34, rob wrote:\n>>> didn't work.  I did not get any error messages, just didn't work.  \n>>> After I did\n>>>\n>>>   git reset --hard\n>>>\n>>>   git status\n>>>\n>>> I see the same 3 files that say changes not staged for commit: \n>>> modified and it lists the same 3 files.\n>> Could this be that the file timestamps are being changed in the \n>> background and git is detecting those timestamp changes, even when \n>> there is no change to the files.\n>> - Just as thought.\n>>\n>> (In-line posting is preferred, so as to see the replies in context)\n>> Philip\n>>\nIf it is that, Try\ncore.trustctime::\n     If false, the ctime differences between the index and the\n     working tree are ignored; useful when the inode change time\n     is regularly modified by something outside Git (file system\n     crawlers and some backup systems).\n     See linkgit:git-update-index[1]. True by default.\n\nOr,\ncore.checkStat::\n     When missing or is set to `default`, many fields in the stat\n     structure are checked to detect if a file has been modified\n     since Git looked at it.  When this configuration variable is\n     set to `minimal`, sub-second part of mtime and ctime, the\n     uid and gid of the owner of the file, the inode number (and\n     the device number, if Git was compiled to use it), are\n     excluded from the check among these fields, leaving only the\n     whole-second part of mtime (and ctime, if `core.trustCtime`\n     is set) and the filesize to be checked.\n>>>\n>>> --rob\n>>>\n>>>\n>>> On 4/21/19 1:03 AM, Adrian H wrote:\n>>>> If I understand the commands you are using correctly, you are\n>>>> referencing the remote repo.  You need to reference the local repo.\n>>>> So try using the following commands:\n>>>>\n>>>> git checkout -- alecthomas/gometalinter\n>>>> git checkout -- kisielk/errcheck\n>>>> git checkout -- rogpeppe/godef\n>>>>\n>>>> Or if those are the only files that have been modified, then you can\n>>>> use the following single command:\n>>>>\n>>>> git reset --hard\n>>>>\n>>>> and that will reset all files that have not been staged.\n>>>>\n>>>> HTH\n>>>>\n>>>>\n>>>> A\n>>>>\n>>>>\n>>>> On Sat, Apr 20, 2019 at 11:22 PM rob <drrob100@fastmail.com> wrote:\n>>>>> I have my own code at a github repository, using Go.  Part of \n>>>>> using Go\n>>>>> libraries not part of the official Go people is by using a system \n>>>>> they\n>>>>> call go get.  This essentially uses git to, well, go get source code.\n>>>>> Mine are at github.com and golang.org.  My computer runs LinuxMint \n>>>>> 19.1.\n>>>>>\n>>>>> I used goland IDE from jetbrains to run go fmt on my entire project.\n>>>>> Now I am getting this message that I cannot get rid of:\n>>>>>\n>>>>> changes not staged for commit:\n>>>>>\n>>>>>     modified: github.com/alecthomas/gometalinter (modified content)\n>>>>>\n>>>>>     modified: github.com/kisielk/errcheck (modified content)\n>>>>>\n>>>>>     modified: github.com/rogpeppe/godef (modified content)\n>>>>>\n>>>>>\n>>>>> I do not want any changes to central repos to be tracked or \n>>>>> committed,\n>>>>> but I cannot undo this.  I tried, for example,\n>>>>>\n>>>>> git checkout -- github.com/alecthomas/gometalinter\n>>>>>\n>>>>> I don't get an error message but it does not do anything. The file is\n>>>>> not changes, and git status show me the same information, ie, these\n>>>>> files have changes not staged for commit.\n>>>>>\n>>>>> I do not know how to restore these files to the state they were in in\n>>>>> the repo, and to have my own git tree not to flag this as an unstaged\n>>>>> alteration.  Running rm -rfv on the repos on my computer, then \n>>>>> running\n>>>>> go get to restore them does not change git status. It still sahs \n>>>>> changes\n>>>>> not stated for commit: modified.\n>>>>>\n>>>>> This happens for the above 3 tree items.\n>>>>>\n>>>>> How do I restore these to the github remote repository condition \n>>>>> and not\n>>>>> have my own git tree mark these as changed?\n>>>>>\n>>>>> --rob solomon\n>>>>>\n>>>>\n>>\n\n"},{"id":"374203","messageId":"6811c1cf-201c-3881-9d46-533d251ba3ce@fastmail.com","threadId":"50960","inReplyTo":"2f3dc6f3-cd6a-7079-d81f-66c101c98a64@iee.org","subject":"Re: I messed up my own git tree and I don't know how to fix it.","fromName":"rob","fromEmail":"drrob100@fastmail.com","sentAt":"2019-04-21T18:53:12Z","receivedAt":"2019-04-21T18:53:16Z","isPatch":false,"sender":{"key":"drrob100@fastmail.com","avatar":null},"body":"I did\n\n   git config --global core.trustctime false\n\n   git config --global core.checkStat minimal\n\nNo difference\n\n-rob\n\nOn 4/21/19 1:22 PM, Philip Oakley wrote:\n> On 21/04/2019 18:07, rob wrote:\n>> possibly. What do I do about that?\n>>\n>> --rob\n>>\n> see below.\n>>\n>> On 4/21/19 9:03 AM, Philip Oakley wrote:\n>>> Hi Rob,\n>>>\n>>> On 21/04/2019 13:34, rob wrote:\n>>>> didn't work.  I did not get any error messages, just didn't work.  \n>>>> After I did\n>>>>\n>>>>   git reset --hard\n>>>>\n>>>>   git status\n>>>>\n>>>> I see the same 3 files that say changes not staged for commit: \n>>>> modified and it lists the same 3 files.\n>>> Could this be that the file timestamps are being changed in the \n>>> background and git is detecting those timestamp changes, even when \n>>> there is no change to the files.\n>>> - Just as thought.\n>>>\n>>> (In-line posting is preferred, so as to see the replies in context)\n>>> Philip\n>>>\n> If it is that, Try\n> core.trustctime::\n>     If false, the ctime differences between the index and the\n>     working tree are ignored; useful when the inode change time\n>     is regularly modified by something outside Git (file system\n>     crawlers and some backup systems).\n>     See linkgit:git-update-index[1]. True by default.\n>\n> Or,\n> core.checkStat::\n>     When missing or is set to `default`, many fields in the stat\n>     structure are checked to detect if a file has been modified\n>     since Git looked at it.  When this configuration variable is\n>     set to `minimal`, sub-second part of mtime and ctime, the\n>     uid and gid of the owner of the file, the inode number (and\n>     the device number, if Git was compiled to use it), are\n>     excluded from the check among these fields, leaving only the\n>     whole-second part of mtime (and ctime, if `core.trustCtime`\n>     is set) and the filesize to be checked.\n>>>>\n>>>> --rob\n>>>>\n>>>>\n>>>> On 4/21/19 1:03 AM, Adrian H wrote:\n>>>>> If I understand the commands you are using correctly, you are\n>>>>> referencing the remote repo.  You need to reference the local repo.\n>>>>> So try using the following commands:\n>>>>>\n>>>>> git checkout -- alecthomas/gometalinter\n>>>>> git checkout -- kisielk/errcheck\n>>>>> git checkout -- rogpeppe/godef\n>>>>>\n>>>>> Or if those are the only files that have been modified, then you can\n>>>>> use the following single command:\n>>>>>\n>>>>> git reset --hard\n>>>>>\n>>>>> and that will reset all files that have not been staged.\n>>>>>\n>>>>> HTH\n>>>>>\n>>>>>\n>>>>> A\n>>>>>\n>>>>>\n>>>>> On Sat, Apr 20, 2019 at 11:22 PM rob <drrob100@fastmail.com> wrote:\n>>>>>> I have my own code at a github repository, using Go.  Part of \n>>>>>> using Go\n>>>>>> libraries not part of the official Go people is by using a system \n>>>>>> they\n>>>>>> call go get.  This essentially uses git to, well, go get source \n>>>>>> code.\n>>>>>> Mine are at github.com and golang.org.  My computer runs \n>>>>>> LinuxMint 19.1.\n>>>>>>\n>>>>>> I used goland IDE from jetbrains to run go fmt on my entire project.\n>>>>>> Now I am getting this message that I cannot get rid of:\n>>>>>>\n>>>>>> changes not staged for commit:\n>>>>>>\n>>>>>>     modified: github.com/alecthomas/gometalinter (modified content)\n>>>>>>\n>>>>>>     modified: github.com/kisielk/errcheck (modified content)\n>>>>>>\n>>>>>>     modified: github.com/rogpeppe/godef (modified content)\n>>>>>>\n>>>>>>\n>>>>>> I do not want any changes to central repos to be tracked or \n>>>>>> committed,\n>>>>>> but I cannot undo this.  I tried, for example,\n>>>>>>\n>>>>>> git checkout -- github.com/alecthomas/gometalinter\n>>>>>>\n>>>>>> I don't get an error message but it does not do anything. The \n>>>>>> file is\n>>>>>> not changes, and git status show me the same information, ie, these\n>>>>>> files have changes not staged for commit.\n>>>>>>\n>>>>>> I do not know how to restore these files to the state they were \n>>>>>> in in\n>>>>>> the repo, and to have my own git tree not to flag this as an \n>>>>>> unstaged\n>>>>>> alteration.  Running rm -rfv on the repos on my computer, then \n>>>>>> running\n>>>>>> go get to restore them does not change git status. It still sahs \n>>>>>> changes\n>>>>>> not stated for commit: modified.\n>>>>>>\n>>>>>> This happens for the above 3 tree items.\n>>>>>>\n>>>>>> How do I restore these to the github remote repository condition \n>>>>>> and not\n>>>>>> have my own git tree mark these as changed?\n>>>>>>\n>>>>>> --rob solomon\n>>>>>>\n>>>>>\n>>>\n>\n"},{"id":"374204","messageId":"6c98c228-2587-bf69-454b-83199a434014@fastmail.com","threadId":"50960","inReplyTo":"6811c1cf-201c-3881-9d46-533d251ba3ce@fastmail.com","subject":"Re: I messed up my own git tree and I don't know how to fix it.","fromName":"rob","fromEmail":"drrob100@fastmail.com","sentAt":"2019-04-21T21:18:00Z","receivedAt":"2019-04-21T21:18:04Z","isPatch":false,"sender":{"key":"drrob100@fastmail.com","avatar":null},"body":"I got it to do what I want.  I have alias nuke='rm -rfv'\n\nSo I did\n\n     nuke github.com/alecthomas/gometalinter (modified content)\n\n     nuke github.com/kisielk/errcheck (modified content)\n\n     nuke github.com/rogpeppe/godef (modified content)\n\n     git rm github.com/alecthomas/gometalinter (modified content)\n\n     git rm github.com/kisielk/errcheck (modified content)\n\n     git rm github.com/rogpeppe/godef (modified content)\n\n     git commit the rm operation.\n\n     go get github.com/alecthomas/gometalinter (modified content)\n\n     go get github.com/kisielk/errcheck (modified content)\n\n     go get github.com/rogpeppe/godef (modified content)\n\n     git add these, then git commit.\n\nAnd my directories are clean when I git status them.\n\nI could not figure out anything else to do.\n\n--rob\n\nOn 4/21/19 2:53 PM, rob wrote:\n> I did\n>\n>   git config --global core.trustctime false\n>\n>   git config --global core.checkStat minimal\n>\n> No difference\n>\n> -rob\n>\n> On 4/21/19 1:22 PM, Philip Oakley wrote:\n>> On 21/04/2019 18:07, rob wrote:\n>>> possibly. What do I do about that?\n>>>\n>>> --rob\n>>>\n>> see below.\n>>>\n>>> On 4/21/19 9:03 AM, Philip Oakley wrote:\n>>>> Hi Rob,\n>>>>\n>>>> On 21/04/2019 13:34, rob wrote:\n>>>>> didn't work.  I did not get any error messages, just didn't work.  \n>>>>> After I did\n>>>>>\n>>>>>   git reset --hard\n>>>>>\n>>>>>   git status\n>>>>>\n>>>>> I see the same 3 files that say changes not staged for commit: \n>>>>> modified and it lists the same 3 files.\n>>>> Could this be that the file timestamps are being changed in the \n>>>> background and git is detecting those timestamp changes, even when \n>>>> there is no change to the files.\n>>>> - Just as thought.\n>>>>\n>>>> (In-line posting is preferred, so as to see the replies in context)\n>>>> Philip\n>>>>\n>> If it is that, Try\n>> core.trustctime::\n>>     If false, the ctime differences between the index and the\n>>     working tree are ignored; useful when the inode change time\n>>     is regularly modified by something outside Git (file system\n>>     crawlers and some backup systems).\n>>     See linkgit:git-update-index[1]. True by default.\n>>\n>> Or,\n>> core.checkStat::\n>>     When missing or is set to `default`, many fields in the stat\n>>     structure are checked to detect if a file has been modified\n>>     since Git looked at it.  When this configuration variable is\n>>     set to `minimal`, sub-second part of mtime and ctime, the\n>>     uid and gid of the owner of the file, the inode number (and\n>>     the device number, if Git was compiled to use it), are\n>>     excluded from the check among these fields, leaving only the\n>>     whole-second part of mtime (and ctime, if `core.trustCtime`\n>>     is set) and the filesize to be checked.\n>>>>>\n>>>>> --rob\n>>>>>\n>>>>>\n>>>>> On 4/21/19 1:03 AM, Adrian H wrote:\n>>>>>> If I understand the commands you are using correctly, you are\n>>>>>> referencing the remote repo.  You need to reference the local repo.\n>>>>>> So try using the following commands:\n>>>>>>\n>>>>>> git checkout -- alecthomas/gometalinter\n>>>>>> git checkout -- kisielk/errcheck\n>>>>>> git checkout -- rogpeppe/godef\n>>>>>>\n>>>>>> Or if those are the only files that have been modified, then you can\n>>>>>> use the following single command:\n>>>>>>\n>>>>>> git reset --hard\n>>>>>>\n>>>>>> and that will reset all files that have not been staged.\n>>>>>>\n>>>>>> HTH\n>>>>>>\n>>>>>>\n>>>>>> A\n>>>>>>\n>>>>>>\n>>>>>> On Sat, Apr 20, 2019 at 11:22 PM rob <drrob100@fastmail.com> wrote:\n>>>>>>> I have my own code at a github repository, using Go.  Part of \n>>>>>>> using Go\n>>>>>>> libraries not part of the official Go people is by using a \n>>>>>>> system they\n>>>>>>> call go get.  This essentially uses git to, well, go get source \n>>>>>>> code.\n>>>>>>> Mine are at github.com and golang.org.  My computer runs \n>>>>>>> LinuxMint 19.1.\n>>>>>>>\n>>>>>>> I used goland IDE from jetbrains to run go fmt on my entire \n>>>>>>> project.\n>>>>>>> Now I am getting this message that I cannot get rid of:\n>>>>>>>\n>>>>>>> changes not staged for commit:\n>>>>>>>\n>>>>>>>     modified: github.com/alecthomas/gometalinter (modified content)\n>>>>>>>\n>>>>>>>     modified: github.com/kisielk/errcheck (modified content)\n>>>>>>>\n>>>>>>>     modified: github.com/rogpeppe/godef (modified content)\n>>>>>>>\n>>>>>>>\n>>>>>>> I do not want any changes to central repos to be tracked or \n>>>>>>> committed,\n>>>>>>> but I cannot undo this.  I tried, for example,\n>>>>>>>\n>>>>>>> git checkout -- github.com/alecthomas/gometalinter\n>>>>>>>\n>>>>>>> I don't get an error message but it does not do anything. The \n>>>>>>> file is\n>>>>>>> not changes, and git status show me the same information, ie, these\n>>>>>>> files have changes not staged for commit.\n>>>>>>>\n>>>>>>> I do not know how to restore these files to the state they were \n>>>>>>> in in\n>>>>>>> the repo, and to have my own git tree not to flag this as an \n>>>>>>> unstaged\n>>>>>>> alteration.  Running rm -rfv on the repos on my computer, then \n>>>>>>> running\n>>>>>>> go get to restore them does not change git status. It still sahs \n>>>>>>> changes\n>>>>>>> not stated for commit: modified.\n>>>>>>>\n>>>>>>> This happens for the above 3 tree items.\n>>>>>>>\n>>>>>>> How do I restore these to the github remote repository condition \n>>>>>>> and not\n>>>>>>> have my own git tree mark these as changed?\n>>>>>>>\n>>>>>>> --rob solomon\n>>>>>>>\n>>>>>>\n>>>>\n>>\n"}]}