# Trouble publishing my first package to GitHub

**URL:** https://discourse.julialang.org/t/trouble-publishing-my-first-package-to-github/93293
**Category:** New to Julia
**Tags:** package, github
**Created:** [January 21, 2023, 2:40am UTC](https://discourse.julialang.org/t/trouble-publishing-my-first-package-to-github/93293 "2023-01-21T02:40:44Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![chadagreene](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chadagreene/32/34924_2.png) [@chadagreene](https://discourse.julialang.org/u/chadagreene)
#### Post date: [January 23, 2023, 1:53am UTC](https://discourse.julialang.org/t/trouble-publishing-my-first-package-to-github/93293/5 "2023-01-23T01:53:32Z")

</div>

Thanks @lmiq. The JuliaNotes page helped me get on the right path, and then I had to figure out a few things on my own. I also found [this excellent tutorial for developing new packages](https://medium.com/coffee-in-a-klein-bottle/developing-your-julia-package-682c1d309507), but unfortunately that page appears to be outdated and might lead to errors. Here are the steps that worked for me:

# 1. Make a new repo via the GitHub web interface.

Log in to GitHub, click the **Repositories** tab, and then click **New**.

 ![Screenshot 2023-01-22 at 5.44.23 PM](https://global.discourse-cdn.com/julialang/original/3X/4/a/4a6a8bf06d8709f7af23925921ddbbf05a04d0a7.png)

Name the repository something ending in .jl, without spaces or special characters. If multiple words are in the package name, capitalize the first letter of each word (e.g., MyPackage.jl). Here, my package is named Foo, so I’ve named the repository Foo.jl:

 ![Screenshot 2023-01-22 at 5.45.31 PM](https://global.discourse-cdn.com/julialang/original/3X/a/5/a53c108852c87fec34bbb86a6816ac21923e6e66.png)

On the same page, I set my repo to **Private** and clicked **Create repository** :

 ![Screenshot 2023-01-22 at 5.46.21 PM](https://global.discourse-cdn.com/julialang/original/3X/b/2/b26ea650e56e2ca456c7519c883d992ada42fb32.png)

# 2. Initialize the package in Julia using PkgTemplates

Launch VS Code, press Ctrl+shift+p and click “Julia: Start REPL”. Then, in the REPL, add the PkgTemplates package if you haven’t already, and type:

```julia
using PkgTemplates 
t = Template(;user="chadagreene", plugins = [GitHubActions(), Codecov()])
t("/Users/cgreene/Documents/GitHub/Foo.jl")

```

Above, I entered my GitHub username, and I also specified the local directory where I want my package to exist on my computer. Specifying the local directory is important for me, as a beginner, because by default, the package management system puts everything in a hidden folder. If you want to see, explore, and easily interact with the files in your new package, specify the filepath to your preferred location as I’ve done above.

And of course, make sure the file path ends in the same name as the repo you just created on GitHub (above, you see that the path ends in Foo.jl).

The three lines of code above create a folder called Foo.jl on your local machine. Again, if you don’t specify a directory, it will end up in a hidden folder called `~/.julia/dev/Foo`, but I’ve placed mine in my `/Users/cgreene/Documents/GitHub/Foo` folder.

_Note: there’s some inconsistency in how PkgTemplates names the folder it creates. Although you need to specify the package name ending in .jl when using PkgTemplates, and you must also end the GitHub repo name with .jl, the folder that PkgTemplates creates will just be Foo, without the .jl._

# 3. Publish the new package via GitHub Desktop

Launch GitHub Desktop, click **Add** and **Add Existing Repository** , like this:

 ![Screenshot 2023-01-22 at 5.49.47 PM](https://global.discourse-cdn.com/julialang/original/3X/2/3/23a56ad3e4f0bc141201d0c6b3d3bf0b3f9d92e3.png)

Now, specify the same directory that we entered into the Julia REPL, and click **Add Repository** :

 ![Screenshot 2023-01-22 at 5.50.48 PM](https://global.discourse-cdn.com/julialang/original/3X/2/4/2426a69c9796d35afba0dfd15ca3ae251c8052cd.png)

Click **Publish branch** :

 ![Screenshot 2023-01-22 at 5.51.04 PM](https://global.discourse-cdn.com/julialang/original/3X/2/5/253eb8c75fe792cd737d73d8fea0578d46e03fe9.png)

# 4. Check online to confirm existence of new repo:

Now if you refresh your **Repositories** tab online, you should see that the new package template has made it into your online repo:

 ![Screenshot 2023-01-22 at 5.51.36 PM](https://global.discourse-cdn.com/julialang/original/3X/1/e/1e3d0bdf1f5deab7c1c811e4c44572ba41c2ef03.png)

---

_[View the full topic](https://discourse.julialang.org/t/trouble-publishing-my-first-package-to-github/93293)._
