What is the Origin in Git?

What is the Origin in Git?

About

origin is the default name for a remote when you run git clone.

If you run git clone -o myRemote instead, then you will have myRemote/master as your default remote branch.

origin designs then often the default alias of a remote repository

Management

As origin define a remote, all actions on origin can also be found in the remote page

Adding

When adding a remote repository, the remote URL alias is named origin.

git remote add origin https://github.com/userName/repositoryName.git

Removing

git remote remove origin

Show

git remote show origin
* remote origin
  Fetch URL: https://github.com/gerardnico/myRepo.git
  Push  URL: https://github.com/gerardnico/myRepo.git
  HEAD branch: master
  Remote branch:
    master tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (local out of date)

Relocate

git remote set-url origin https://github.com/gerardnico/newRepo.git





Discover More
Git - Tag

This page is tagging in git Git has the ability to tag specific points in history as being important. Typically this functionality is used to mark release points (v1.0, and so on). Git uses two main...



Share this page:
Follow us:
Task Runner