Git Product home page Git Product logo

git-merge-testing's Introduction

What?

Git merging and pushing is hard for beginners as the distributed nature of git is non-trivial to internalize.

This script sets up a repo with a few base commits and multiple clones with new commits simulating separate users.

A new user can generate this test bed to experiment with fetchin/pulling/merging/rebasing and such.

Installation

user@host:~/git$ git clone [email protected]:azzid/git-merge-testing.git
Cloning into 'git-merge-testing'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (2/2), done.
Receiving objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
user@host:~/git$ cd git-merge-testing/
user@host:~/git/git-merge-testing$ chmod u+x generate-gittery.sh
user@host:~/git/git-merge-testing$ ./generate-gittery.sh
Initialized empty Git repository in /home/user/git/git-merge-testing/repo.git/
Cloning into 'repo'...
warning: You appear to have cloned an empty repository.
done.
Cloning into 'repo'...
warning: You appear to have cloned an empty repository.
done.
Cloning into 'repo'...
warning: You appear to have cloned an empty repository.
done.
[main (root-commit) b534f4c] 1
 1 file changed, 1 insertion(+)
 create mode 100644 main
[main 0b31f24] 2
 1 file changed, 1 insertion(+), 1 deletion(-)
[main 31fa61e] 3
 1 file changed, 1 insertion(+), 1 deletion(-)
[main 8987863] 4
 1 file changed, 1 insertion(+), 1 deletion(-)
[main b08f844] 5
 1 file changed, 1 insertion(+), 1 deletion(-)
Enumerating objects: 15, done.
Counting objects: 100% (15/15), done.
Delta compression using up to 8 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (15/15), 987 bytes | 329.00 KiB/s, done.
Total 15 (delta 1), reused 0 (delta 0), pack-reused 0
To /home/user/git/git-merge-testing/repo.git
 * [new branch]      main -> main
Already up to date.
Switched to a new branch 'main-dev'
[main-dev 77f3a67] main: 6
 1 file changed, 1 insertion(+), 1 deletion(-)
[main-dev 3a8bf60] main: 7
 1 file changed, 1 insertion(+), 1 deletion(-)
[main-dev 145d5b9] main: 8
 1 file changed, 1 insertion(+), 1 deletion(-)
[main-dev 75f1ba4] main: 9
 1 file changed, 1 insertion(+), 1 deletion(-)
[main-dev dfa5835] main: 10
 1 file changed, 1 insertion(+), 1 deletion(-)
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 15 (delta 1), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (15/15), 967 bytes | 120.00 KiB/s, done.
From /home/user/git/git-merge-testing/repo
 * [new branch]      main       -> origin/main
Switched to a new branch 'secondary-dev'
[secondary-dev dcb5b0c] secondary: 11
 1 file changed, 1 insertion(+)
 create mode 100644 secondary
[secondary-dev 0e7d51e] secondary: 12
 1 file changed, 1 insertion(+), 1 deletion(-)
[secondary-dev 4db0f44] secondary: 13
 1 file changed, 1 insertion(+), 1 deletion(-)
[secondary-dev 24cbb80] secondary: 14
 1 file changed, 1 insertion(+), 1 deletion(-)
[secondary-dev 217d467] secondary: 15
 1 file changed, 1 insertion(+), 1 deletion(-)
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 15 (delta 1), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (15/15), 967 bytes | 161.00 KiB/s, done.
From /home/user/git/git-merge-testing/repo
 * [new branch]      main       -> origin/main
Switched to a new branch 'teritiary-dev'
[teritiary-dev fc68afd] teritiary: 16
 1 file changed, 1 insertion(+)
 create mode 100644 teritiary
[teritiary-dev e896803] teritiary: 17
 1 file changed, 1 insertion(+), 1 deletion(-)
[teritiary-dev 5d81ef5] teritiary: 18
 1 file changed, 1 insertion(+), 1 deletion(-)
[teritiary-dev cc78386] teritiary: 19
 1 file changed, 1 insertion(+), 1 deletion(-)
[teritiary-dev 6a072a5] teritiary: 20
 1 file changed, 1 insertion(+), 1 deletion(-)
repo.git:
* b08f844 (HEAD -> main) 5
* 8987863 4
* 31fa61e 3
* 0b31f24 2
* b534f4c 1
main-dev:
* dfa5835 (HEAD -> main-dev) main: 10
* 75f1ba4 main: 9
* 145d5b9 main: 8
* 3a8bf60 main: 7
* 77f3a67 main: 6
* b08f844 (origin/main, main) 5
* 8987863 4
* 31fa61e 3
* 0b31f24 2
* b534f4c 1
secondary-dev:
* 217d467 (HEAD -> secondary-dev) secondary: 15
* 24cbb80 secondary: 14
* 4db0f44 secondary: 13
* 0e7d51e secondary: 12
* dcb5b0c secondary: 11
* b08f844 (origin/main, main) 5
* 8987863 4
* 31fa61e 3
* 0b31f24 2
* b534f4c 1
teritiary-dev:
* 6a072a5 (HEAD -> teritiary-dev) teritiary: 20
* cc78386 teritiary: 19
* 5d81ef5 teritiary: 18
* e896803 teritiary: 17
* fc68afd teritiary: 16
* b08f844 (origin/main, main) 5
* 8987863 4
* 31fa61e 3
* 0b31f24 2
* b534f4c 1

Goal

Something like:

user@host:~/git/git-merge-testing/main-dev$ git log --oneline --graph --all
*   f706fc7 (HEAD -> main, origin/main, main-dev) Merge branch 'teritiary-dev'
|\  
| * 6a072a5 teritiary: 20
| * cc78386 teritiary: 19
| * 5d81ef5 teritiary: 18
| * e896803 teritiary: 17
| * fc68afd teritiary: 16
* |   b5b6e77 Merge branch 'secondary-dev'
|\ \  
| * | 217d467 secondary: 15
| * | 24cbb80 secondary: 14
| * | 4db0f44 secondary: 13
| * | 0e7d51e secondary: 12
| * | dcb5b0c secondary: 11
| |/  
* | dfa5835 main: 10
* | 75f1ba4 main: 9
* | 145d5b9 main: 8
* | 3a8bf60 main: 7
* | 77f3a67 main: 6
|/  
* b08f844 5
* 8987863 4
* 31fa61e 3
* 0b31f24 2
* b534f4c 1

git-merge-testing's People

Contributors

mattiasatwork avatar azzid avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.