Skip to content

Instantly share code, notes, and snippets.

@joachimdoerr
Forked from canton7/gist:1053846
Created November 3, 2015 10:18
Show Gist options
  • Select an option

  • Save joachimdoerr/386ea1a99f758d35cab9 to your computer and use it in GitHub Desktop.

Select an option

Save joachimdoerr/386ea1a99f758d35cab9 to your computer and use it in GitHub Desktop.

Revisions

  1. @canton7 canton7 revised this gist Oct 10, 2011. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    `git clone path/to/test/repo.git`

    push.default = matching
    =======================
    push.default = matching (the default)
    ====================================

    ```
    git config push.default matching
  2. @canton7 canton7 revised this gist Oct 8, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -108,7 +108,7 @@ git branch -D origin_test
    push.default = tracking
    =======================

    (I'm using 1.7.4 msysgit, use push.default upstream for 1.7.6)
    (I'm using 1.7.4 msysgit, use push.default upstream for 1.7.6+)

    `git config push.default tracking`

  3. @canton7 canton7 renamed this gist Oct 8, 2011. 1 changed file with 17 additions and 3 deletions.
    20 changes: 17 additions & 3 deletions gistfile1.txt → gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,21 @@
    git clone path/to/test/repo.git
    `git clone path/to/test/repo.git`

    push.default = matching
    =======================

    ```
    git config push.default matching
    git branch -a
    * master
    origin/master
    origin/test
    ```

    Pushing a tracking branch of the same name
    ------------------------------------------

    ```
    git checkout -t origin/test
    Branch test set up to track remote branch test from origin.
    Switched to new branch 'test'
    @@ -28,10 +31,12 @@ git push
    *Pushes master and test to origin*
    git branch -D test
    ```

    Pushing a tracking branch of a different name
    ---------------------------------------------

    ```
    git checkout -b origin_test origin/test
    Branch origin_test set up to track remote branch test from origin.
    Switched to new branch 'origin_test'
    @@ -50,10 +55,12 @@ git push
    *Pushes master to origin*
    git branch -D test
    ```

    Pushing a non-tracking branch of the same name
    ----------------------------------------------

    ```
    git checkout --no-track -b test origin/test
    Switched to new branch 'test'
    @@ -71,10 +78,12 @@ git push
    *Pushes master and test to origin*
    git branch -D test
    ```

    Pushing a non-tracking branch of a different name
    -------------------------------------------------

    ```
    git checkout --no-track -b origin_test origin/test
    Switched to new branch 'origin_test'
    @@ -94,17 +103,19 @@ git push origin
    *Pushes master to origin*
    git branch -D origin_test
    ```

    push.default = tracking
    =======================

    (I'm using 1.7.4 msysgit, use push.default upstream for 1.7.6)

    git config push.default tracking
    `git config push.default tracking`

    Pushing a tracking branch
    -------------------------

    ```
    git checkout -t origin/test
    Branch test set up to track remote branch test from origin.
    Switched to new branch 'test'
    @@ -115,10 +126,12 @@ git push
    *Pushes test to origin*
    git branch -D test
    ```

    Pushing a non-tracking branch of the same or different name
    -----------------------------------------------------------

    ```
    git checkout --no-track -b test origin/test
    Switched to new branch 'test'
    @@ -127,4 +140,5 @@ echo eight > test && git add test && git commit -m "Test file 8"
    git push
    fatal: No destination configured to push to
    git push origin
    fatal: The current branch test is not tracking anything.
    fatal: The current branch test is not tracking anything.
    ```
  4. @canton7 canton7 revised this gist Jun 29, 2011. 1 changed file with 25 additions and 12 deletions.
    37 changes: 25 additions & 12 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -10,8 +10,8 @@ git branch -a
    origin/master
    origin/test

    Pushing a tracking branch
    -------------------------
    Pushing a tracking branch of the same name
    ------------------------------------------

    git checkout -t origin/test
    Branch test set up to track remote branch test from origin.
    @@ -29,6 +29,28 @@ git push

    git branch -D test

    Pushing a tracking branch of a different name
    ---------------------------------------------

    git checkout -b origin_test origin/test
    Branch origin_test set up to track remote branch test from origin.
    Switched to new branch 'origin_test'

    echo two_point_one > test && git add test && git commit -m "Test file 2.1"
    git push
    *Pushes master to origin*

    echo two_point_two > test && git commit -am "Test file 2.2"
    git push origin
    *Pushes master to origin*

    echo two_point_three > test && git commit -am "Test file 2.3"
    git checkout master
    git push
    *Pushes master to origin*

    git branch -D test

    Pushing a non-tracking branch of the same name
    ----------------------------------------------

    @@ -105,13 +127,4 @@ echo eight > test && git add test && git commit -m "Test file 8"
    git push
    fatal: No destination configured to push to
    git push origin
    fatal: The current branch test is not tracking anything.









    fatal: The current branch test is not tracking anything.
  5. @canton7 canton7 created this gist Jun 29, 2011.
    117 changes: 117 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,117 @@
    git clone path/to/test/repo.git

    push.default = matching
    =======================

    git config push.default matching

    git branch -a
    * master
    origin/master
    origin/test

    Pushing a tracking branch
    -------------------------

    git checkout -t origin/test
    Branch test set up to track remote branch test from origin.
    Switched to new branch 'test'

    echo one > test
    git add test && git commit -m "Test file 1"
    git push
    *Pushes master and test to origin*

    echo two > test && git commit -am "Test file 2"
    git checkout master
    git push
    *Pushes master and test to origin*

    git branch -D test

    Pushing a non-tracking branch of the same name
    ----------------------------------------------

    git checkout --no-track -b test origin/test
    Switched to new branch 'test'

    echo three > test && git add test && git commit -m "Test file 3"

    git push
    fatal: No destination configured to push to.
    git push origin
    *Pushes master and test to origin*

    echo four > test && git commit -am "Test file 4"

    git checkout master
    git push
    *Pushes master and test to origin*

    git branch -D test

    Pushing a non-tracking branch of a different name
    -------------------------------------------------

    git checkout --no-track -b origin_test origin/test
    Switched to new branch 'origin_test'

    echo five > test && git add test && git commit -m "Test file 5"

    git push
    fatal: No destination configured to push to.
    git push origin
    *Pushes master to origin*

    echo six > test && git commit -am "Test file 6"

    git checkout master
    git push
    *Pushes master to origin*
    git push origin
    *Pushes master to origin*

    git branch -D origin_test

    push.default = tracking
    =======================

    (I'm using 1.7.4 msysgit, use push.default upstream for 1.7.6)

    git config push.default tracking

    Pushing a tracking branch
    -------------------------

    git checkout -t origin/test
    Branch test set up to track remote branch test from origin.
    Switched to new branch 'test'

    echo seven > test && git add test && git commit -m "Test file 7"

    git push
    *Pushes test to origin*

    git branch -D test

    Pushing a non-tracking branch of the same or different name
    -----------------------------------------------------------

    git checkout --no-track -b test origin/test
    Switched to new branch 'test'

    echo eight > test && git add test && git commit -m "Test file 8"

    git push
    fatal: No destination configured to push to
    git push origin
    fatal: The current branch test is not tracking anything.