Skip to content

Instantly share code, notes, and snippets.

@pixrr
Forked from hofnerb/remote_url.md
Created November 4, 2018 09:47
Show Gist options
  • Select an option

  • Save pixrr/fd2e1432efaa9a3d9b4b7e51d47d9335 to your computer and use it in GitHub Desktop.

Select an option

Save pixrr/fd2e1432efaa9a3d9b4b7e51d47d9335 to your computer and use it in GitHub Desktop.

Revisions

  1. @hofnerb hofnerb revised this gist Apr 13, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions remote_url.md
    Original file line number Diff line number Diff line change
    @@ -18,10 +18,10 @@ git remote -v
    git branch -vv
    ```

    ### Push `local_branch` to remote `branch_with_different_name`
    ### Push `local_branch` to remote `remote_branch`, i.e., to a branch with a different name
    ```
    ## to set the pull
    git push -u remote local_branch:branch_with_different_name
    git push -u remote local_branch:remote_branch
    ## to set the default push
    git config push.default upstream
    ```
  2. @hofnerb hofnerb revised this gist Apr 13, 2015. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion remote_url.md
    Original file line number Diff line number Diff line change
    @@ -20,5 +20,9 @@ git branch -vv

    ### Push `local_branch` to remote `branch_with_different_name`
    ```
    ## to set the pull
    git push -u remote local_branch:branch_with_different_name
    ```
    ## to set the default push
    git config push.default upstream
    ```
    (see http://stackoverflow.com/a/5739015/2574238 and http://stackoverflow.com/a/5740047/2574238)
  3. @hofnerb hofnerb revised this gist Apr 13, 2015. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions remote_url.md
    Original file line number Diff line number Diff line change
    @@ -16,4 +16,9 @@ git remote -v
    ### Check remote tracking repository
    ```
    git branch -vv
    ```

    ### Push `local_branch` to remote `branch_with_different_name`
    ```
    git push -u remote local_branch:branch_with_different_name
    ```
  4. @hofnerb hofnerb revised this gist Apr 13, 2015. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion remote_url.md
    Original file line number Diff line number Diff line change
    @@ -11,4 +11,9 @@ git remote -v
    # Verify new remote URL
    ```

    (Source: http://stackoverflow.com/a/19298943/2574238)
    (Source: http://stackoverflow.com/a/19298943/2574238)

    ### Check remote tracking repository
    ```
    git branch -vv
    ```
  5. @hofnerb hofnerb created this gist Apr 10, 2015.
    14 changes: 14 additions & 0 deletions remote_url.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    ### Review and Change Remote URL

    ```
    git remote -v
    # View existing remotes
    git remote set-url origin https://github.com/user/repo2.git
    # Change the 'origin' remote's URL
    git remote -v
    # Verify new remote URL
    ```

    (Source: http://stackoverflow.com/a/19298943/2574238)