DEV Community

Cover image for Push local repository to another user remote repository
Emdadul Islam
Emdadul Islam

Posted on

Push local repository to another user remote repository

To push changes from your local repository to another user's repository, you will need to have push access to that repository. If you do not have push access, you will need to ask the owner of the repository to grant you access.

If you have push access to the repository, you can follow these steps:

Clone the repository to your local machine using git clone and the repository's URL.

git clone https://github.com/user/repo.git
Enter fullscreen mode Exit fullscreen mode

Change into the repository's directory.

cd repo
Enter fullscreen mode Exit fullscreen mode

Make the necessary changes and commit them to your local repository.

Add the remote repository as a remote for your local repository. Replace user and repo with the appropriate values.

git remote add upstream https://github.com/user/repo.git
Enter fullscreen mode Exit fullscreen mode

Push your changes to the remote repository.

git push upstream
Enter fullscreen mode Exit fullscreen mode

Alternatively, you can also use a GUI client for Git such as GitHub Desktop or GitKraken to push changes to a remote repository.

Top comments (0)