# Unable to push my package to GitHub

**URL:** <https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193>\
**Category:** New to Julia\
**Tags:** github\
**Created:** [June 28, 2020, 9:52am UTC](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193 "2020-06-28T09:52:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbpatzer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jbpatzer/32/15355_2.png) [@jbpatzer](https://discourse.julialang.org/u/jbpatzer)\
**Post date:** [June 28, 2020, 9:52am UTC](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193/1 "2020-06-28T09:52:13Z")

</div>

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](https://global.discourse-cdn.com/julialang/original/3X/2/4/24ddf081e1479ab4d74cb3d5ecaa4656428bac8b.png)

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. 😢 Any help much appreciated.

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [June 28, 2020, 10:27am UTC](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193/2 "2020-06-28T10:27:55Z")

</div>

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

```nohighlight
git pull origin master

```

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

---

<div class="post-metadata">

**Author:** ![jbpatzer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jbpatzer/32/15355_2.png) [@jbpatzer](https://discourse.julialang.org/u/jbpatzer)\
**Post date:** [June 28, 2020, 10:59am UTC](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193/3 "2020-06-28T10:59:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [June 28, 2020, 11:02am UTC](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193/4 "2020-06-28T11:02:06Z")

</div>

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:

```julia
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.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [June 28, 2020, 11:08am UTC](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193/5 "2020-06-28T11:08:12Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [June 28, 2020, 11:13am UTC](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193/6 "2020-06-28T11:13:22Z")

</div>

> [@jbpatzer](#):
>
> The local repo is the one with everything working. The remote one is newly created.

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

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [June 28, 2020, 11:24am UTC](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193/7 "2020-06-28T11:24:45Z")

</div>

> [@jbpatzer](#):
>
> 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.

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

> **[GitHub - JuliaCI/PkgTemplates.jl: Create new Julia packages, the easy way](https://github.com/JuliaCI/PkgTemplates.jl)**
>
> Create new Julia packages, the easy way. Contribute to JuliaCI/PkgTemplates.jl development by creating an account on GitHub.

This is documented in  
[https://julialang.github.io/Pkg.jl/v1/creating-packages/](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/](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/](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 !

---

<div class="post-metadata">

**Author:** ![jbpatzer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jbpatzer/32/15355_2.png) [@jbpatzer](https://discourse.julialang.org/u/jbpatzer)\
**Post date:** [June 28, 2020, 11:42am UTC](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193/8 "2020-06-28T11:42:38Z")

</div>

> [@oheil](#):
>
> 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:
> 
> ```julia-auto
> 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.

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

> [@oheil](#):
>
> 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!

Fair enough.

> [@giordano](#):
>
> 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

I was careful not to do that.

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

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [June 28, 2020, 11:49am UTC](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193/9 "2020-06-28T11:49:55Z")

</div>

> [@jbpatzer](#):
>
> Awesome. Thanks v much. Still annoyed that Juliapro couldn’t do this automatically though,

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

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [June 28, 2020, 12:11pm UTC](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193/10 "2020-06-28T12:11:16Z")

</div>

> [@jbpatzer](#):
>
> 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 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.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [June 28, 2020, 12:48pm UTC](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193/11 "2020-06-28T12:48:22Z")

</div>

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 😃  
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 😃

I don’t find a point what I want to say… 🙄 😆

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [June 28, 2020, 1:09pm UTC](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193/12 "2020-06-28T13:09:56Z")

</div>

> [@oheil](#):
>
> Why not using JuliaPro (for any reason you like) and still ask questions here?

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.

> [@oheil](#):
>
> And Point 3 is true but wasn’t expected otherwise in this thread. OP didn’t demand anything.

I understood [this reply](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193/3) 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).

---

<div class="post-metadata">

**Author:** ![jbpatzer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jbpatzer/32/15355_2.png) [@jbpatzer](https://discourse.julialang.org/u/jbpatzer)\
**Post date:** [June 28, 2020, 1:24pm UTC](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193/13 "2020-06-28T13:24:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [June 28, 2020, 1:28pm UTC](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193/14 "2020-06-28T13:28:38Z")

</div>

> [@Tamas\_Papp](#):
>
> Don’t get me wrong

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.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [June 28, 2020, 1:30pm UTC](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193/15 "2020-06-28T13:30:54Z")

</div>

> [@jbpatzer](#):
>
> 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.

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.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [June 28, 2020, 1:33pm UTC](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193/16 "2020-06-28T13:33:34Z")

</div>

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”)

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [June 28, 2020, 1:36pm UTC](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193/17 "2020-06-28T13:36:05Z")

</div>

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](https://github.com/Microsoft/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.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [June 28, 2020, 1:43pm UTC](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193/18 "2020-06-28T13:43:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [June 28, 2020, 1:59pm UTC](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193/19 "2020-06-28T13:59:48Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [June 28, 2020, 2:01pm UTC](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193/20 "2020-06-28T14:01:28Z")

</div>

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

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)

[Next page](https://discourse.julialang.org/t/unable-to-push-my-package-to-github/42193.md?page=2)
