Question

Are there some use cases when creating commits with a past date is beneficial?

This is how and this is how it looks like in GitHub

What is the effect of creating past commits on merging? Or is this just a log rendering issue? What I want to understand is, if people I work with start making past edits, what effects this can have on logs, merging, other extenal reports, etc.

Was it helpful?

Solution

Use cases?

GitHub Contributions calendar

I created an NodeJS application that creates dummy commits in the past to get a really nice GitHub contribution calendar: https://github.com/IonicaBizau/github-contributions

Contributions calendar

The contributions calendar shows how frequently you've been contributing over the past year. Clicking on a day shows the contributions made during that timeframe. If you hold shift and click on another day, you'll see your contributions in that timespan.

Exampe

After designing your GitHub contribution calendar (in browser) you click the Generate button:

The following JSON is generated:

{
    "coordinates": [
        {
            "x": 6,
            "y": 2
        },
        {
            "x": 6,
            "y": 6
        },
        {
            "x": 7,
            "y": 2
        },
        {
            "x": 7,
            "y": 3
        },
        {
            "x": 7,
            "y": 4
        },
        {
            "x": 7,
            "y": 5
        },
        {
            "x": 7,
            "y": 6
        },
        {
            "x": 8,
            "y": 2
        },
        {
            "x": 8,
            "y": 6
        },
        {
            "x": 11,
            "y": 3
        },
        {
            "x": 11,
            "y": 4
        },
        {
            "x": 12,
            "y": 2
        },
        {
            "x": 12,
            "y": 3
        },
        {
            "x": 12,
            "y": 4
        },
        {
            "x": 12,
            "y": 5
        },
        {
            "x": 13,
            "y": 2
        },
        {
            "x": 13,
            "y": 3
        },
        {
            "x": 13,
            "y": 4
        },
        {
            "x": 13,
            "y": 5
        },
        {
            "x": 13,
            "y": 6
        },
        {
            "x": 14,
            "y": 3
        },
        {
            "x": 14,
            "y": 4
        },
        {
            "x": 14,
            "y": 5
        },
        {
            "x": 14,
            "y": 6
        },
        {
            "x": 14,
            "y": 7
        },
        {
            "x": 15,
            "y": 2
        },
        {
            "x": 15,
            "y": 3
        },
        {
            "x": 15,
            "y": 4
        },
        {
            "x": 15,
            "y": 5
        },
        {
            "x": 15,
            "y": 6
        },
        {
            "x": 16,
            "y": 2
        },
        {
            "x": 16,
            "y": 3
        },
        {
            "x": 16,
            "y": 4
        },
        {
            "x": 16,
            "y": 5
        },
        {
            "x": 17,
            "y": 3
        },
        {
            "x": 17,
            "y": 4
        },
        {
            "x": 19,
            "y": 3
        },
        {
            "x": 19,
            "y": 4
        },
        {
            "x": 19,
            "y": 5
        },
        {
            "x": 20,
            "y": 2
        },
        {
            "x": 20,
            "y": 6
        },
        {
            "x": 21,
            "y": 2
        },
        {
            "x": 21,
            "y": 4
        },
        {
            "x": 21,
            "y": 6
        },
        {
            "x": 22,
            "y": 2
        },
        {
            "x": 22,
            "y": 4
        },
        {
            "x": 22,
            "y": 6
        },
        {
            "x": 23,
            "y": 4
        },
        {
            "x": 23,
            "y": 5
        },
        {
            "x": 25,
            "y": 2
        },
        {
            "x": 25,
            "y": 6
        },
        {
            "x": 26,
            "y": 2
        },
        {
            "x": 26,
            "y": 3
        },
        {
            "x": 26,
            "y": 4
        },
        {
            "x": 26,
            "y": 5
        },
        {
            "x": 26,
            "y": 6
        },
        {
            "x": 27,
            "y": 2
        },
        {
            "x": 27,
            "y": 6
        },
        {
            "x": 29,
            "y": 2
        },
        {
            "x": 29,
            "y": 3
        },
        {
            "x": 30,
            "y": 2
        },
        {
            "x": 30,
            "y": 6
        },
        {
            "x": 31,
            "y": 2
        },
        {
            "x": 31,
            "y": 3
        },
        {
            "x": 31,
            "y": 4
        },
        {
            "x": 31,
            "y": 5
        },
        {
            "x": 31,
            "y": 6
        },
        {
            "x": 32,
            "y": 2
        },
        {
            "x": 32,
            "y": 6
        },
        {
            "x": 33,
            "y": 2
        },
        {
            "x": 33,
            "y": 3
        },
        {
            "x": 35,
            "y": 2
        },
        {
            "x": 35,
            "y": 3
        },
        {
            "x": 35,
            "y": 4
        },
        {
            "x": 35,
            "y": 5
        },
        {
            "x": 35,
            "y": 6
        },
        {
            "x": 36,
            "y": 4
        },
        {
            "x": 37,
            "y": 4
        },
        {
            "x": 38,
            "y": 2
        },
        {
            "x": 38,
            "y": 3
        },
        {
            "x": 38,
            "y": 4
        },
        {
            "x": 38,
            "y": 5
        },
        {
            "x": 38,
            "y": 6
        },
        {
            "x": 40,
            "y": 2
        },
        {
            "x": 40,
            "y": 3
        },
        {
            "x": 40,
            "y": 4
        },
        {
            "x": 40,
            "y": 5
        },
        {
            "x": 41,
            "y": 6
        },
        {
            "x": 42,
            "y": 6
        },
        {
            "x": 43,
            "y": 2
        },
        {
            "x": 43,
            "y": 3
        },
        {
            "x": 43,
            "y": 4
        },
        {
            "x": 43,
            "y": 5
        },
        {
            "x": 45,
            "y": 2
        },
        {
            "x": 45,
            "y": 6
        },
        {
            "x": 46,
            "y": 2
        },
        {
            "x": 46,
            "y": 3
        },
        {
            "x": 46,
            "y": 4
        },
        {
            "x": 46,
            "y": 5
        },
        {
            "x": 46,
            "y": 6
        },
        {
            "x": 47,
            "y": 2
        },
        {
            "x": 47,
            "y": 4
        },
        {
            "x": 47,
            "y": 6
        },
        {
            "x": 48,
            "y": 2
        },
        {
            "x": 48,
            "y": 4
        },
        {
            "x": 48,
            "y": 6
        },
        {
            "x": 49,
            "y": 3
        },
        {
            "x": 49,
            "y": 5
        },
        {
            "x": 51,
            "y": 2
        },
        {
            "x": 51,
            "y": 3
        },
        {
            "x": 51,
            "y": 4
        },
        {
            "x": 51,
            "y": 6
        }
    ],
    "commitsPerDay": 40
}

Then you just click the Generate repository from data button:

If you can't see an gif image above, click here.

After downloading the generated zip file, just unzip it and push the repository on your GitHub account.

Then your GitHub contributions calendar can look like mine:

If you have any questions just open an issue on GitHub. :-)

OTHER TIPS

The only use-case that makes sense is an import from another versioning system. Say if you port from SVN other to Git, which is of course a very common use case. The only sane way do this is to transfer from an old system to a new system, i.e. to apply this transfer (hack) only once, and use good tools for the transition. Otherwise your data is basically corrupt. Once you have a corrupted system, there is no good way of doing things.

GitHub keeps track of your commits over time, and displays it publicly as your 'streak'. One may want to create a commit in the past so one doesn't break the streak (though this is kind of cheating).

I've also seen commits in the past used to say "Of course I fixed that bug last week" (nice try, bub).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top