How to configure remote upstream without `git push`?

Member

by shyann , in category: Third Party Scripts , 3 months ago

How to configure remote upstream without `git push`?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by elisha_langworth , 3 months ago

@shyann 

To configure a remote upstream without using git push, you can use the following steps:

  1. Add the remote upstream repository to your local repository using the following command:
1
git remote add upstream <remote_repository_url>


Replace <remote_repository_url> with the actual URL of the upstream repository.

  1. Fetch the changes from the upstream repository to sync your local repository with it using the following command:
1
git fetch upstream


  1. Merge the changes from the remote upstream repository into your local repository using the following command (assuming you are on the master branch):
1
git merge upstream/master


By following these steps, you can configure a remote upstream repository without using git push and keep your local repository in sync with the upstream repository.