Skip to content

Git Notes

  • Clone a remote repository to a local repository:

    git clone <remote-repository-url> <optional-dir>
    git clone https://github.com/Ross-Thanscheidt/Notes.git
    cd Notes
    git clone https://github.com/Ross-Thanscheidt/Example.git MyExample
    cd MyExample
  • Clone a remote repository using GitHub CLI:

    gh repo list
    gh repo clone Notes
    cd Notes
  • Get URL of the remote repository in the local repository:

    git remote get-url origin
  • Update local repository from remote repository

    • Safe - merge commits from remote repository with local master branch

      git fetch
      git rebase
    • Aggressive - fetch and rebase without reviewing downloaded changes

      git pull