Skip to content

Instantly share code, notes, and snippets.

@supriya-premkumar
Last active December 1, 2019 00:26
Show Gist options
  • Select an option

  • Save supriya-premkumar/fd9a1aaacace992372fdf1eb9880b11f to your computer and use it in GitHub Desktop.

Select an option

Save supriya-premkumar/fd9a1aaacace992372fdf1eb9880b11f to your computer and use it in GitHub Desktop.
Git cheat sheet

Configure a remote for a fork

1. List configured current repository
git remote -v

> origin  https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
> origin  https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)


2. Configuring remote for a fork
git remote add <give- name-for-fork-repo> <forked ssh url>

$ git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git


3. Verify new forked remote repo addition in the previous step
git remote -v

> origin    https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
> origin    https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)
> upstream  https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch)
> upstream  https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (push)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment