git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Adrian H <adrianh.bsc@gmail.com>
To: rob@drrob1.com
Cc: git@vger.kernel.org
Subject: Re: I messed up my own git tree and I don't know how to fix it.
Date: Sun, 21 Apr 2019 01:03:17 -0400	[thread overview]
Message-ID: <CAP_kE8XaFW=G1f_qrS2sEp+ELQ9otk=j0-ZtbF1dATQX8ZjrAA@mail.gmail.com> (raw)
In-Reply-To: <cb1f725f-1314-d320-104a-726ef1c906fa@fastmail.com>

If I understand the commands you are using correctly, you are
referencing the remote repo.  You need to reference the local repo.
So try using the following commands:

git checkout -- alecthomas/gometalinter
git checkout -- kisielk/errcheck
git checkout -- rogpeppe/godef

Or if those are the only files that have been modified, then you can
use the following single command:

git reset --hard

and that will reset all files that have not been staged.

HTH


A


On Sat, Apr 20, 2019 at 11:22 PM rob <drrob100@fastmail.com> wrote:
>
> I have my own code at a github repository, using Go.  Part of using Go
> libraries not part of the official Go people is by using a system they
> call go get.  This essentially uses git to, well, go get source code.
> Mine are at github.com and golang.org.  My computer runs LinuxMint 19.1.
>
> I used goland IDE from jetbrains to run go fmt on my entire project.
> Now I am getting this message that I cannot get rid of:
>
> changes not staged for commit:
>
>    modified: github.com/alecthomas/gometalinter (modified content)
>
>    modified: github.com/kisielk/errcheck (modified content)
>
>    modified: github.com/rogpeppe/godef (modified content)
>
>
> I do not want any changes to central repos to be tracked or committed,
> but I cannot undo this.  I tried, for example,
>
> git checkout -- github.com/alecthomas/gometalinter
>
> I don't get an error message but it does not do anything.  The file is
> not changes, and git status show me the same information, ie, these
> files have changes not staged for commit.
>
> I do not know how to restore these files to the state they were in in
> the repo, and to have my own git tree not to flag this as an unstaged
> alteration.  Running rm -rfv on the repos on my computer, then running
> go get to restore them does not change git status. It still sahs changes
> not stated for commit: modified.
>
> This happens for the above 3 tree items.
>
> How do I restore these to the github remote repository condition and not
> have my own git tree mark these as changed?
>
> --rob solomon
>


-- 
========================================
            Adrian Hawryluk
         BSc. Computer Science
----------------------------------------
           Specialising in:
        OOD Methodologies in UML
  OOP Methodologies in C, C++ and more
        RT Embedded Programming
            GUI Development
========================================

  reply	other threads:[~2019-04-21  5:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-21  3:01 I messed up my own git tree and I don't know how to fix it rob
2019-04-21  5:03 ` Adrian H [this message]
2019-04-21 12:34   ` rob
2019-04-21 13:03     ` Philip Oakley
2019-04-21 17:07       ` rob
2019-04-21 17:22         ` Philip Oakley
2019-04-21 18:53           ` rob
2019-04-21 21:18             ` rob
2019-04-21 13:14 ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP_kE8XaFW=G1f_qrS2sEp+ELQ9otk=j0-ZtbF1dATQX8ZjrAA@mail.gmail.com' \
    --to=adrianh.bsc@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=rob@drrob1.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).