New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: get get -u all
fails!
#18859
Comments
Is this a one-time failure or you can reproduce this reliably? If it's the latter, can you provide instructions on how to reproduce the failure? Was the repository that triggered the failure in a strange state? Did you have uncommited changes? |
Sounds like you had manually modified a package's source and git is complaining that it would lose your changes if There's not enough information here to help you, but it sounds like it did the right thing and protected you from losing your modifications. For questions about Go, see https://golang.org/wiki/Questions. If you have a reproducible bug report, or more details, feel free to reopen. |
I did not modify the source, though... And there should really be some flag to overwrite any conflicts either way. While I cannot reproduce it for you, Googling the error message shows some extra git commands you should run to overwrite... |
But git says the source was modified and if we can't reproduce this there's no way to debug a possible problem / tell if
I don't think a flag is needed. Note that you don't need to delete the dependency to fix the problem: just run |
Oh... I am a giant idiot. I never even tried running the commands because I thought it would be more complicated than that... Never really used Git. Thanks for everything =) |
It happened again. I did NO changes to the thing, at least not myself (thinking if some third party app did. Really doubt it though.). Running I can confirm |
Most (if not all) dependency managers put your dependencies into a disconnected Head state (for non-git gurus, this means it changes the branch from master). IOW, does this look similar to your workflow?
This basically will break any full Instead, you should be using the latest version of Go (1.6+) and:
This resolved all my issues over the last few years across various dev machines and VMs that all started around Go 1.1 or 1.2 and I keep upgrading them. Kind of a PITA during this transition actually. |
Mine worked after stashing them a second time. It hasn't asked me again so far. |
I suspect you have a tool or your workflow has some scripting that keeps attempting to restore certain versions of those repos. It's a lot more common than you think: I've even seen Anyhow.. Before running
If number 2 shows them in an If it indeed shows modified files, then perhaps some installer tooling is running a Makefile or some other installation tool and modifying sources. But Either way, it is something on your system and/or in your daily workflow that keeps modifying them. In the end, you are going to have to find it, fix it, and move on. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.7.4 linux/amd64
What operating system and processor architecture are you using (
go env
)?Linux Mint (linux), AMD64
What did you do?
I had an old version of a library. I was going to update it.
I ran
go get -u all
What did you expect to see?
The plugin updated.
What did you see instead?
That changes would be overwritten, and "Please, commit your changes or stash them before you can merge" and abort. I had to reinstall".
No update was applied
To update I had to uninstall and reinstall the dependency
The text was updated successfully, but these errors were encountered: