Skip to content

App tutorials

3 min read

How to push to GitHub

By Jessica Lau · April 24, 2025
Hero image with the GitHub logo

There are plenty of ways to use GitHub: the website, the app, or the terminal. The terminal is the best way to sync local projects to a GitHub repository, and once you learn the basics, you'll be able to push local projects to remote GitHub repositories in seconds.

Here's a step-by-step guide on how to push to GitHub.

Table of contents:

What does it mean to push to GitHub?

Pushing to GitHub is a secure and convenient way to upload files to or update existing files in a remote GitHub repository.

For example, let's say you just created a new public repository for a project and you want to upload all your files to it. To do that, you would push your files to GitHub. Or maybe you're continually working on a project from a private GitHub repository for your company, and you want to upload the latest changes that you've made. That would also require you to push the changes to GitHub.

How to push to GitHub

Here's a step-by-step guide on how to push to GitHub. Note: Your Git terminal may look different depending on your operating system (I'm using Windows), but the steps are the same. 

Before we continue, make sure you've installed and enabled Git on your local machine. 

  1. Go to the web page for your GitHub repository, and note the URL. 

    Example of where to find the URL for a GitHub repository.

  2. Open Bash on Windows. (If you're using Linux or Mac, open Terminal.) 

  3. Use the cd command to switch to the directory you want to use to work on your project locally.

    Cd command in GitHub.

  4. Enter git clone [URL of your repository] to copy your repository to your local machine.

    Code entered in GitHub to copy the GitHub repository to a local machine.

  5. Use the cd command to go into your repository directory. You'll know you're in the right place if your new command line ends with the name of the main branch of your repository. For example, the name of my main branch is "main," so (main) appears at the end of my command line.

    GitHub repository directory.

  6. Once you've added your files to your directory and are ready to push to GitHub, in your Bash window, enter git add . to select all the files in your repository. 

  7. Enter git commit -m "[commit message]" to save the changes to your local repository. You can enter anything for the commit message, but adding -m "[commit message]" specifies what this code change is doing, so it's helpful to be clear and concise.

    How to save changes to a local repository.

  8. Enter git push origin [branch name] to save your code changes to GitHub.

    How to save code changes to GitHub.

If you haven't already done so, GitHub will prompt you to authenticate your identity. Enter your GitHub username and password. Once the authentication is done, the upload process will start. After it's complete, you'll see specific details about where the data was uploaded.

That's it! You've successfully pushed your local files and folders to your GitHub repository. 

To double-check that you pushed to GitHub successfully, open your GitHub repository web page. Your code changes should appear there. 

GitHub repository web page with a list of code changes.

Automate GitHub with Zapier

Zapier lets you connect GitHub to thousands of apps, so you can automate more of your Git processes. For example, you can automatically get a notification or create a task in your project management tool whenever there's a new pull request in your repository. Or you can notify others about new commits to your repo.

Learn more about how to automate GitHub and connect it to thousands of other apps, or get started with one of these templates.

Get direct messages on Slack for new GitHub mentions

  • GitHub logo
  • Slack logo
GitHub + Slack
More details
    People talk to you on more places than Slack, but all the information can still be centralized on your chat app. Set up this automation and we'll do the rest: It will trigger when a new issue is added on GitHub, automatically sending you a direct message on Slack with everything you need to jump right in.

    Send Discord channel messages for new commits in Github

    • GitHub logo
    • Discord logo
    GitHub + Discord
    More details
      Someone just made a new commit in your software development tool, you'll want to make sure you and your team get notified. Zapier helps by sending a channel message in Discord when there is a new commit in GitHub. You and your team will be up to date on any new commits going forward.

      Create Trello cards from new GitHub issues

      • GitHub logo
      • Trello logo
      GitHub + Trello
      More details
        Automate your workflows with this integration. After you set it up, this Zap automatically creates a Trello card for each new GitHub issue that is opened on a chosen repository. Keep your tasks organized without any added clicks or keystrokes.

        Zapier is the leader in workflow automation—integrating with thousands of apps from partners like Google, Salesforce, and Microsoft. Use interfaces, data tables, and logic to build secure, automated systems for your business-critical workflows across your organization's technology stack. Learn more.

        Related reading:

        This article was originally published in June 2019 by Khamosh Pathak. The most recent full update was in September 2023, and the article was fact-checked and lightly updated in April 2025.

        Get productivity tips delivered straight to your inbox

        We’ll email you 1-3 times per week—and never share your information.

        Related articles

        Improve your productivity automatically. Use Zapier to get your apps working together.

        A Zap with the trigger 'When I get a new lead from Facebook,' and the action 'Notify my team in Slack'