๐Ÿ“ Git & GitHub

Publishing Your First Repository on GitHub ๐Ÿš€

P
Author
PyLand Team
๐Ÿ“…
Published
06.05.2026
โฑ๏ธ
Reading time
3 min
๐Ÿ‘๏ธ
Views
442
๐ŸŒฑ
Level
Beginner

Created a local Git repository and want to share it with the world? Here’s how to publish your project on GitHub!

What Is Publishing?

Publishing means uploading your local repository to GitHub.

Before publishing:
- Code is only on your computer
- No backup
- Can’t share with the team

After publishing:
- Code is on GitHub (in the cloud)
- Accessible from any device
- Can work in a team
- Show it in your portfolio

Method 1: Via GitHub Desktop

Step 1: Create a local repository

If you haven’t done it yet:

  1. File โ†’ New Repository
  2. Fill in:
    - Name: my-awesome-project
    - Description: “My first project”
    - โœ… Initialize with README
  3. Create Repository

Step 2: Make changes

  1. Add files to the project folder
  2. They’ll appear in GitHub Desktop under Changes
  3. Make a commit:
    - Summary: Add project files
    - Commit to main

Step 3: Publish!

  1. Find the Publish repository button (top right)
  2. A settings window opens:

```
Name: my-awesome-project
Description: My first project

โ˜ Keep this code private

[Cancel] [Publish Repository]
```

  1. Configure the settings:
    - Name โ€” can change it
    - Description โ€” optional
    - Keep this code private โ€” uncheck for a public repository

  2. Click Publish Repository

  3. Wait 10-30 seconds…

โœ… Done! Your code is on GitHub!

Verify

  1. Click View on GitHub
  2. A browser will open with your repository
  3. URL will be: github.com/your-username/my-awesome-project

Public vs Private Repository

Public โœ…

Pros:
- โœ… Free and unlimited
- โœ… Visible to everyone on the internet
- โœ… Can show to employers
- โœ… Indexed by search engines
- โœ… Can add to portfolio

Cons:
- โŒ Everyone sees your code
- โŒ Can’t store secrets (API keys, passwords)

When to use:
- Learning projects
- Open source
- Portfolio
- Public libraries

Private ๐Ÿ”’

Pros:
- โœ… Only you and invited users can see it
- โœ… Can store private code
- โœ… Free (used to be paid!)

Cons:
- โŒ Not visible in portfolio
- โŒ Requires inviting collaborators

When to use:
- Commercial projects
- Code with secrets
- Unfinished work
- Internal company tools

What Happens During Publishing?

GitHub Desktop:

  1. Creates the repository on GitHub.com
  2. Adds a remote (connection to GitHub):
    bash git remote add origin https://github.com/username/repo.git
  3. Pushes all commits
  4. Pushes all branches
  5. Sets up tracking

After Publishing

Now you have two places where your code lives:

1. Local
- On your computer
- In the project folder

2. Origin (on GitHub)
- On GitHub’s servers
- Accessible from the internet

Syncing

Upload changes (Push):
- Made commits locally
- Click Push origin (โ†‘)
- Commits are sent to GitHub

Download changes (Pull):
- Someone changed code on GitHub
- Click Pull origin (โ†“)
- Changes are downloaded to you

Check for updates (Fetch):
- Click Fetch origin
- GitHub Desktop checks for new commits
- Nothing changes locally

Common Issues

“Repository name already exists”

You already have a repository with that name!

Fix:
1. Rename the new one: my-project-v2
2. Or delete the old one on GitHub
3. Or use a different account

“Authentication failed”

GitHub Desktop can’t log in to your account.

Fix:
1. File โ†’ Options โ†’ Accounts
2. Sign out
3. Sign in again

“Couldn’t publish repository”

Internet problem or GitHub is down.

Fix:
1. Check your internet connection
2. Open github.com in a browser (is it working?)
3. Disable VPN/proxy
4. Try again in a few minutes

Accidentally made it private

No problem! You can change it:

  1. Open the repository on GitHub
  2. Settings
  3. Scroll down โ†’ Danger Zone
  4. Change visibility โ†’ Make public
  5. Confirm

Security: Don’t Publish Secrets!

โŒ NEVER publish:

  • API keys
  • Passwords
  • Tokens
  • Private keys (SSH, SSL)
  • .env files with secrets
  • Database credentials

โœ… Solution:

Use .gitignore:

# .gitignore
.env
secrets.json
*.key
config/local.py

These files will NOT go into Git!

Pre-publish Checklist

Before clicking Publish:

  1. โœ… Check .gitignore โ€” no secrets?
  2. โœ… Read README โ€” is it clear what the project does?
  3. โœ… Remove temp files (.DS_Store, Thumbs.db)
  4. โœ… Check the license โ€” added a LICENSE file?
  5. โœ… Make sure the code works

What’s Next?

After publishing:

  1. โœ… Add a description on the GitHub page
  2. โœ… Add topics (tags) for discoverability
  3. โœ… Create a good README.md
  4. โœ… Add a license (LICENSE file)
  5. โœ… Share on social media! ๐ŸŽ‰

Your first repository on GitHub is a big step! Congratulations! ๐Ÿš€

Your reaction to the article

๐Ÿ’ฌ Comments (0)

๐Ÿ” Sign in to leave a comment
๐Ÿšช Login
๐Ÿ’ญ

No comments yet

Be the first to share your opinion about this article!

๐Ÿ”— Similar

Similar articles

Continue learning with these materials

๐Ÿ“

Undo and Revert in GitHub Desktop: Fix Mistakes Wโ€ฆ

A commit is not a point of no return. GitHub Desktop lets you rebuild a...

๐Ÿ“… 16.07.2026 ๐Ÿ‘๏ธ 359
๐Ÿ“

History, Diffs, and Web Commits on GitHub

GitHub lets you read repository history, inspect individual commit diffs, view the history of one...

๐Ÿ“… 16.07.2026 ๐Ÿ‘๏ธ 312
๐Ÿ“

Your First Git Commit

Your first commit starts with initializing a repository, configuring the author identity, and selecting the...

๐Ÿ“… 30.06.2026 ๐Ÿ‘๏ธ 343
๐ŸŽ“ Continue learning

Courses that cover this material

Visit the course to apply this material in practice.

Git & GitHub Desktop: Teamwork Without the Pain Open course curriculum Markup for Backend Developers Open course curriculum