Push updates to a repository

Once you make changes to your files and commit to your local repository, you'll need to push them to the remote Bitbucket Cloud repository so that other people can see them too.

To push to a repository, you need write access for that repository. If you can't push and think you should have that access, ask your repository administrator to grant you access.

To push to a Git repository

  1. At the command line, make sure you've changed into the repository directory.

  2. Enter git push at the command line to push your commits from your local repository to Bitbucket. To be specific about exactly where you're pushing, enter git push <remote_server> <branch_name>. This command specifies you're pushing to:

    • remote_server — the name of the remote server. In most cases, origin indicates that you're pushing to Bitbucket.

    • branch_name — the repository branch where you made your changes and want to push them. A branch allows you do work on a set of code for your repository separate from the main codebase.

  3. If prompted for authentication, enter your Bitbucket username and app password.
    In this example, origin is the remote server and main is the branch where you're pushing:

    $ git push origin main
    Password:
    Counting objects: 6, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (3/3), done.
    Writing objects: 100% (4/4), 23.98 KiB, done.
    Total 4 (delta 0), reused 0 (delta 0)
    remote: bb/acl: alui is allowed. accepted payload.
    To https://alui@staging.bitbucket.org/alui/alui-git-fork.git
       0ad86b3..395d3c2  main -> main

Open your Bitbucket repository in your browser. The Commits tab shows your most recent commits.

Additional Help