Unable to push my package to GitHub

I’ve managed to convert my code from MATLAB to Julia, turned it into a module, and then a package, and committed some changes using git, all in Juliapro. I now want to get the package onto Github. I have watched videos, read posts and articles, and gone all around the houses with this, but I keep ending up with the same error. After I create the repo on Github and try to force a push to it from my local repo, I get

Annotation 2020-06-28 104352

This appears to be the last thing I need to do to say that I have fully reproduced my MATLAB code as a Julia package, and it’s driving me nuts. I’m slightly worried that I’m the only person in the universe trying to do this from Juliapro, as there isn’t a scrap of help anywhere online about how to do it from this environment. Google has, for once, not been my friend. :cry: Any help much appreciated.

To be clear, this is a git issue and has nothing to do with julia itself. It looks like your local repository is out of sync with the remote one. From the command line you can run

git pull origin master

to try and get the changes that are there but not locally, as also suggested by the error message.

2 Likes

The local repo is the one with everything working. The remote one is newly created.

I realise it’s a git issue, but if everyone’s encouraged to install Juliapro, and it comes with git and GitHub extensions active by default, it becomes a Julia community issue. I’m new to Julia, and this is what I’m presented with. If it doesn’t work without hours of fiddling about, or indeed not at all, it reflects badly on Julia. I’m really surprised that Juliapro doesn’t have any helpful documentation about this at all when surely it’s a central part of software development.

You have probably two different repos with the same name: a local one with your package you have worked on and a remote repo which you have created on github.

You have to set the origin of your local repo. Here are the commands to do that:

git remote rm origin
git remote add origin https://github.com/PATH/TO/YOUR/REMOTE/REPO
git config master.remote origin
git config master.merge refs/heads/master

After this do
git push -f origin master
on a git command line or as proposed in your screenshot, forcing the push.

3 Likes

No reason for getting upset with Julia.
It is a github issue, or to be more specific: it is an issue of a user, who hasen’t enough background with github to see the real issue. No offense ment here, it is just normal and there is no obligation to become a github expert before using Julia.

@giordano just stated the obvious to make it clear to you and others again without offense

If it doesn’t work without hours of fiddling about, or indeed not at all, it reflects badly on Julia.

Don’t waste too much time, come here and ask early and you will see how nice this community is and how this reflects great on Julia!

2 Likes

When you created it on Github, did you initialise it with, for example, a README or a license? Than that’s the issue, because in this way the remote repository has a different history compared to the local one

1 Like

It wouldn’t make sense to reiterate the github documentation in JuliaPro.

The recommended way of creating a package (from the beginning) is to use

This is documented in
https://julialang.github.io/Pkg.jl/v1/creating-packages/

Which again is linked from the main documentation here:
https://docs.julialang.org/en/v1/stdlib/Pkg/

I admit, facing your problem like you did, isn’t so easily solved by just refering to “Read the docs”. For beginners (Julia and Git) it is probably impossible to solve your issue in reasonable time. Again: we are all happy to help!

There is still more to this. To help us to help you, you may consider this
https://docs.julialang.org/en/v1/stdlib/Pkg/
which is probably the highest ranked article here measured on links to it! Thanks to @Tamas_Papp !

1 Like

Awesome. Thanks v much. Still annoyed that Juliapro couldn’t do this automatically though,

Fair enough.

I was careful not to do that.

Thanks all for your help. I’m much happier now! :heart_eyes:

1 Like

If this is done automatically it would overwrite existing remote repos without warning. No, we are happy that this is not automatic :slight_smile:

I am happy that your issue is resolved, but please note that

  1. It is not true that everyone is encouraged to install JuliaPro — specifically, I would discourage it for users who depend on community support. Personally I mostly ignore JuliaPro-specific questions because I don’t have it installed so I can’t replicate problems.

  2. It may not be reasonable to expect community support for a product that has paid support available. Generally, you should decide whether you want JuliaPro or plain vanilla Julia depending on the kind of support you need and are willing to pay for.

  3. Community support is provided by volunteers. User questions do not become “community issues” that the community is obligated to address in any sense.

5 Likes

I slightly disagree here.
Why not using JuliaPro (for any reason you like) and still ask questions here?
Or other way round: I may use plain Julia and pay for support if I like (and have the money).

AFAIK, JuliaPro is free, isn’t it? Paid support is an option and available if wanted.

I don’t see any “either this than that” here. Its not mutually dependent.

And Point 3 is true but wasn’t expected otherwise in this thread. OP didn’t demand anything.

Sometimes the tone in this discussions is not unambiguous which leads to this meta discussions. To make it explicit: I feel :smiley:
OP got a little bit upset because of hours trying to solve a git problem, nothing found in the JuliaPro-Docs (are there any specific docs for JuliaPro? I don’t know.), asking here, got some little rebuke, felt nothing done wrong, … and so on. Just nothing happend, issue solved, everybody happy now :smiley:

I don’t find a point what I want to say… :roll_eyes: :laughing:

1 Like

Of course all Julia users should feel free to ask questions here.

However, the broader issue is that many people install JuliaPro because they expect it to be somehow “better” (like Pro versions of various consumer goods, ranging from digital cameras to kitchen utensils, are usually more durable, versatile, etc).

They may not realize that while the JuliaPro bundle offers various advantages, these come with trade-offs. These include limited community support for JuliaPro-specific problems, simply because not many people are familiar with it or even have it installed.

I understood this reply to @giordano’s point about this being a git issue differently. I don’t think that suggesting that git issues are dealt with here or else “it reflects badly on Julia” is the right approach to these discussions.

Don’t get me wrong, I am happy to see people helping each other with Julia-related git issues here, and frequently try to help out myself. I just think that this is a courtesy (like getting expert help on questions of linear algebra, PDEs, MCMC, etc, which are not strictly related to Julia): it is nice when it happens, but in case it doesn’t, it doesn’t reflect on Julia (the language, or the community).

1 Like

What you’ve all said about Juliapro is very interesting. Coming from a background of 25 years mainly using MATLAB, you can imagine that trying Julia is a bit if a culture shock for me. My feeling is that I was encouraged just to download Juliapro, at which point I see an interface that is rather misleadingly similar to MATLAB. However, I’m not stupid. I get what you’re saying. Not using Juliapro would probably help me to adjust. So do you old hands use a shell plus an editor and leave it at that? Maybe a nice git interface as well? If this is too far off topic, feel free to ignore me.

2 Likes

I don’t get you wrong. Too much you have done for all of us already to get you wrong.

Our discussion here is more or less intended for the OP and others to clarify what issues we have with statements like “it reflects badly on Julia”. This wasn’t meant against @giordano but reflecting the frust with JuliaPro (and the Git issue which was perceived as some part of it).
I think he already understood, so do I with the way he came into this.

First I disagreed slightly, now as things are more clarified, I am 100% with you.

1 Like

I personally use Emacs + julia-mode + julia-repl + magit, but that’s an acquired taste (eg if you are already an Emacs user).

If you prefer a full-blown IDE, I think that the future-proof choice at the moment is VS Code.

1 Like

I would say (and last year’s Julia Developer Survey points to this as well), that the most common setup is probably Juno followed by VSCode, not “just a shell”.

It is of course perfectly possible however to run Juno without JuliaPro, it’s just not pre-bundled, i.e. one has to separately download and install the components (which is quite simple for Juno thanks to the uber-juno Atom package, and from what I understand also a one-click install with VSCode).

The main difference then is that JuliaPro has a more curated list of packages, which provides some additional protection against breakages/inconsistencies at the cost of lagging behind somewhat, which can complicate getting community help (if the answer on here is “just update to the latest version of package X”)

3 Likes

I switch regularily depending on what I try to do:

  1. VS Code with Julia extensions for Julia as programming language
  2. Plain Julia REPL currently in a Windows Terminal for Julia as a data analysis tool

People have been asking for something similar to RStudio, but i think there is currently nothing as good as this for Julia. I think this is what MATLAB users would like to have.

At the risk of completely derailing this thread, what RStudio features are you missing in VSCode? I use Juno and can’t think of anything I’m missing from RStudio

Well, fortunately for you, you can rely on a large number of technical support staff here, on Discourse. :slight_smile:

This is one of the cool things I love about Julia.

The original purpose of this thread has found a happy end, so it can’t be derailed :wink:

I never used RStudio so I do not miss anything in VSCode. I think the difference is something else and it is the reason why we have meta discussions again and again (actually I was thinking about creating general thread about this, but it may be not so important):

The issue is, Julia is two worlds:

  1. A general purpose programming language
  2. A tool for data analysis

(there is probably more, but this two are the main two categories to put Julia in)

This two viewpoints lead sometimes to expectations which aren’t fullfilled. They generate two different type of beginners and sometimes to missunderstandings.

I am not sure if somebody who used MATLAB over years is currently satisfied using VSCode. The MATLAB IDE is probably focused on data analysis (I didn’t used MATLAB neither, guessing here). For me VSCode is more targeted on the general programmer, like Visual Studio or Eclipse.

Is there a special name for an IDE which is targeted to data analysts? There should be.

This, the two worlds, is a major issue for Julia.
(Sorry, I have to stay a little bit vague here because I have to leave now. Back in a few hours)