Coder Social home page Coder Social logo

git-family's Introduction

git-family

Repository commit messages:

          a---b--------c----d---e     feature
         /                 /
0---1---2---3---4---------5---6---7   master
             \
              ------z                 unrelated
  • All commit a file with the same name but:
    • Commit "d" doesn't commit any file.
    • Commit "7" commits the readme.
  • Refs listed in the side column.
  • HEAD pointing to e (but not actually relevant).
  • --oneline included to help with visualization.
  • Consider adding --no-merges if needed by the use case.

(1) All commits visible from e, branching at merges following both parents)

Command:

git rev-list --oneline feature

Output:

aadd169 e
59bb7e6 d
9366c7a 5
c2a24eb c
caf2955 4
4dd76ec b
7191789 3
f95deab a
11356dd 2
4f625fa 1
aaeee73 0
  • We see both feature and master history w/o unrelated commits.

(2) Same as (1), but following first parents

Command:

git rev-list --first-parent --oneline feature

Output:

aadd169 e
59bb7e6 d
c2a24eb c
4dd76ec b
f95deab a
11356dd 2
4f625fa 1
aaeee73 0
  • We only see history of 'feature' but commits before first merge are included even if they are not in 'feature'.
  • Because commit "a" doesn't know about branches, "2" is the first parent from its point of view.

(3) Same as (1), but remove commits visible from master

Command:

git rev-list --oneline feature ^master

Output:

aadd169 e
59bb7e6 d
c2a24eb c
4dd76ec b
f95deab a
  • This works as if they were sets and you substract one from another.

Shorthand for ^ syntax if HEAD in e:

git rev-list --oneline master..

Voila!

git-family's People

Contributors

fjfnaranjo 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.