Computer scienceSystem administration and DevOpsGitHub

Publishing your project on GitHub

3 minutes read

Your project is complete! Now it's time to consider sharing it with the world, so your friends or potential employers can see it.

A portfolio showcasing your projects can increase your chances of landing a new job. A well-crafted portfolio featuring real-world projects helps you stand out and may make employers more likely to choose you. In this section, you'll learn two ways to share your Hyperskill projects on GitHub.

You can also find this information in our Hyperskill support pages.

Create the repository

First, you need to create a repository for your future project.

A repository is where GitHub stores all the project files.

To do this, go to GitHub and sign in to your account. Then click on the "New" button in the upper left corner of your Dashboard or give your repo a name, and click "Create new repository":

Screenshot showing the create new repo options from Github dashboard.

If you choose "New", a new page will appear where you can enter all the necessary information: the name of the repository and an optional brief description of the repository:

Screenshot of a 'Create a new repository' page with fields for repository name and description filled out.

If you checked "Add a README file", chose a license, or added a .gitignore template, the new repo will have each of these in their corresponding files: README.md, LICENSE, and .gitignore. You can learn more about them in the provided links. After clicking "Create repository", you'll be redirected to the new repository.

Screenshot of a GitHub repository page named "hyperskill-demo" with files and a description.

Otherwise, your repository will not have any files and the page will have instructions on how to add files to your new repo:

Screenshot of a GitHub repository setup page with instructions for initializing a new repo and adding collaborators.

Great, you now have a repository hosted on GitHub!

Finding your project files

Now it's time to switch to an IDE where you developed your project. Depending on the programming language and IDE, your project files will be in different locations. On the left side of the IDE, in the project panel, you can view the course structure for the project (remember to switch from "Course" to "Project" view). Let's start with a Python project like Web Calendar:

Screenshot of a code editor's project file structure with various Python files and directories.

For Python projects, app.py is the only file you need to add to your repository because this is the file where you wrote your code. It may have other names like main.py or task.py. You can also include requirement.txt which has all the packages needed to run your code. Other files are directly related to the platform and are necessary to check your solutions. They do not belong in your project repository. You can right-click this file and "Open In Explorer." In most cases, the project exists in the task folder within the project directory: ~/PycharmProjects/ProjectName/ProjectName/task/ or %USERPROFILE%/PycharmProjects/ProjectName/ProjectName/task/ on Windows OS.

If you are working in IntelliJ IDEA or WebStorm for Java/Kotlin/Scala projects, you will find project files in the src folder. In Android Studio, they can be found within src/main/. Again, you can view them in Explorer/Finder. In general, the path will be as follows: ~/[IdeaProjects|WebstromProjects]/ProjectName/ProjectName/task/src/ProjectName or %USERPROFILE%/[IdeaProjects|WebstromProjects]/ProjectName/ProjectName/task/src/ProjectName. Let's take a look at Maze Runner (Kotlin), for example:

Screenshot of an IDE with a project directory structure for a Kotlin application called "Maze Runner".

Here, you can also add configuration files: build.gradle as well as settings.gradle.

Now that you know where your project files are, there are several ways to publish them on GitHub. You can either add the files using the GitHub web interface, command line, built-in IDE tools, or even GitHub Desktop. It's up to you. We will cover posting via the IDE as well as the GitHub web interface on this topic.

Publishing Hyperskill Projects to GitHub via IDE

JetBrains IDEs integrate Git functionality by providing a built-in version control system (VCS) interface. You can clone repositories, manage branches, commit changes, resolve conflicts, and push updates directly from the IDE. This greatly streamlines development workflows without needing external Git tools or command-line usage. This means you can post your projects directly to GitHub, among other things.

As soon as you complete all stages, you will find a "Post project to GitHub" link on the check panel:

Screenshot of an educational interface with examples, user input notation explanation, and a message congratulating on project completion.

Alternatively, you can use the VCS tab in your IDE:

Screenshot of an Integrated Development Environment (IDE) with a project's file structure visible and version control options.

You'll see a standard IDEA dialog suggesting posting to GitHub:

Dialog box for sharing a project on GitHub with repository name, remote, and description fields.

You will be able to select the files you want to add to your repository in the next dialog. Remember, only your project files and settings/dependencies (Python requirements and Gradle configuration) are necessary:

Version control interface showing files for initial commit with 'main.py' and 'requirements.txt' selected.

Adding files via the GitHub web interface

Time to go back to the page of the first repository. The process of adding files via the web interface is quite intuitive. Click on the "Add file" button and select "Upload files":

GitHub repository interface showing file list with a prompt to add a README file.

You will see the following page:

Pasted illustration

Go to the directory you discovered in the previous section and drag the necessary file to this window, or select "choose your files" and select the file. It is a good practice to fill in the commit information according to the Conventional Commits specification and add some description about the files you add. After you are done, click the "Commit changes" button. GitHub will add your file to the repository!

Screenshot of a GitHub repository page showing recent commits and a README description.

To verify everything is working as expected, you can do the following:

  1. Post project to GitHub;

  2. Clone it locally;

  3. Check that the solution can be run.

Great job, now you're all set! Your colleagues and future employers can now see all the amazing projects you've been doing.

Conclusion

Congratulations on completing your project! You now know how to publish it on GitHub. There are several ways to do this, including using the Integrated Development Environment (IDE), the web interface, the console application, or GitHub Desktop. Regardless of the method you select, your project is now visible to the world.

As you enhance your portfolio, adding diverse projects will significantly increase its impact. By including a variety of projects, you can strengthen and enrich your portfolio's breadth. This not only sharpens your skills but also helps create a well-rounded portfolio that will impress both friends and potential employers. Happy coding

58 learners liked this piece of theory. 2 didn't like it. What about you?
Report a typo