Keresés

Új hozzászólás Aktív témák

  • Jester01

    veterán

    válasz Jester01 #14887 üzenetére

    Íme:

    $ git init mine
    Initialized empty Git repository in /tmp/mine/.git/
    $ cd mine
    $ git config user.name 'Me Myself'
    $ git config user.email 'me@example.com'
    $ echo mine > test.txt
    $ git add test.txt
    $ git commit -m 'My commit'
    [master (root-commit) 7afaf52] My commit
    1 files changed, 1 insertions(+), 0 deletions(-)
    create mode 100644 test.txt
    $ cd ..
    $ git clone mine other
    Cloning into other...
    done.
    $ cd other
    $ git config user.name 'A U Thor'
    $ git config user.email 'author@example.com'
    $ echo other > test.txt
    $ git add test.txt
    $ git commit -m 'Other commit'
    [master 0ac3ca2] Other commit
    1 files changed, 1 insertions(+), 1 deletions(-)
    $ cd ../mine
    $ git fetch ../other
    remote: Counting objects: 5, done.
    remote: Total 3 (delta 0), reused 0 (delta 0)
    Unpacking objects: 100% (3/3), done.
    From ../other
    * branch HEAD -> FETCH_HEAD
    $ git cherry-pick 0ac3ca2
    Finished one cherry-pick.
    [master 4ea18f5] Other commit
    Author: A U Thor <author@example.com>
    1 files changed, 1 insertions(+), 1 deletions(-)
    $ git log --pretty=full
    commit 4ea18f55d353900b46e18ae6d099063257adcda3
    Author: A U Thor <author@example.com>
    Commit: Me Myself <me@example.com>

    Other commit

    commit 7afaf5285c67bf39acec42f8dbd312724dccc49e
    Author: Me Myself <me@example.com>
    Commit: Me Myself <me@example.com>

    My commit
    $ cat test.txt
    other

Új hozzászólás Aktív témák