Maintain Lost GitHub Streak | For Past Dates | GitHub Flaw or Not?
Tags: webdev, javascript, programming, abotwrotethis
Published: 2024-06-08 17:32:18

# Maintain Lost GitHub Streak | For Past Dates | GitHub Flaw or Not?

Hey, Dev Community! 👋

Have you ever missed a day of committing and watched your precious GitHub streak go down the drain? 😱 Well, I discovered a nifty trick to backdate your commits and keep that streak alive! Let’s dive into it.

## How I Found This Trick

So, there I was, happily maintaining my GitHub streak, when I missed a day. 😓 My streak broke, and I was determined to find a way to fix it. That's when I stumbled upon this trick. You can backdate your commits and even set them to future dates! This got me thinking—is this a serious flaw in the GitHub system? 🤔 Let’s find out together!

## Step-by-Step Guide

### 1. Change Your System Date

First, let's roll back the time on your machine. On a Mac, follow these steps:

1. Open **System Preferences**.
2. Go to **Date & Time**.
3. Unlock the settings if needed by clicking the lock icon and entering your password.
4. Change the date to the day you missed (e.g., June 1).

### 2. Make a Commit

Next, make a commit as if it was that day:

1. Open your terminal.
2. Navigate to the Git repository you want to commit to.
3. Make the necessary changes or create a new file.
4. Stage and commit the changes with a commit message. For example:
   ```sh
   git add .
   git commit -m "Backdated commit to maintain streak"
   ```

### 3. Sync Your Changes

Push the commit to your remote repository:

```sh
git push
```

### 4. Verify on GitHub

Check your GitHub profile to ensure the contribution is recorded for the adjusted date. Your streak should now be intact! 🎉

### 5. Revert System Date

Don't forget to change your system date back to the current date and time:

1. Go back to **System Preferences**.
2. Set the date and time to the current day and time.
3. Lock the settings to prevent further changes.

## Is This a GitHub Flaw? 🤔

This trick works because GitHub tracks contributions based on the commit timestamp. By changing your system's date, you can make GitHub think the commit was made on a different day. But this raises a question—is this a serious flaw in GitHub’s system?

On one hand, it can be handy to maintain your streak. On the other hand, it might be seen as manipulating your contribution history, which some might frown upon. What do you think? Share your thoughts in the comments below! 💬

## Bonus: Future Commits

Oh, and guess what? You can also set your system date to the future and make commits. Check out [this commit history](https://github.com/SH20RAJ/react-hooksh/commits/main/) where I tried it out! 😜

## Conclusion

Maintaining a GitHub streak can be motivating, but don’t stress if you miss a day. Use this trick responsibly, and focus on consistent coding practice over time.



## Before and Afters


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fxx5ithxjpf1di2flhof.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vnw5dsrg1i5yvjssg8q8.png)

---


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b2ro983ealcxpyn3lo8z.png)




![Before](https://camo.githubusercontent.com/85f93b87da41769e1ca29d2f836711aba0357413c0324756f67f2944dae12484/68747470733a2f2f73747265616b2d73746174732e64656d6f6c61622e636f6d3f757365723d7368323072616a267468656d653d68696768636f6e747261737426626f726465725f7261646975733d3426646174655f666f726d61743d4d2532306a2535422532432532305925354426636172645f77696474683d3530302664617465733d323636314542267374726f6b653d323530443044)
Before


![After](https://streak-stats.demolab.com/?user=sh20raj&theme=highcontrast&border_radius=4&date_format=M%20j%5B%2C%20Y%5D&card_width=500&dates=2661EB&stroke=250D0D)
After


---


## Practical

 <img width="1470" alt="Screenshot 2024-06-08 at 11 41 42 PM" src="https://github.com/SH20RAJ/sh20raj/assets/66713844/16c2c286-8a75-4d39-97c6-bb3d44f76c93">
<img width="1470" alt="Screenshot 2024-06-08 at 11 32 39 PM" src="https://github.com/SH20RAJ/sh20raj/assets/66713844/967771ad-d655-4fcc-a7e7-247865925fb4">
<img width="1470" alt="Screenshot 2024-06-08 at 11 38 09 PM" src="https://github.com/SH20RAJ/sh20raj/assets/66713844/adbef026-04f1-4894-bc06-ff34fa70eb78">
<img width="1470" alt="Screenshot 2024-06-08 at 11 40 48 PM" src="https://github.com/SH20RAJ/sh20raj/assets/66713844/f3bab455-af2e-4f5e-8c1c-39b4d05037c0">
<img width="1470" alt="Screenshot 2024-06-08 at 11 41 21 PM" src="https://github.com/SH20RAJ/sh20raj/assets/66713844/4ac8b255-2086-4c31-810e-57f3e73c8962">
<img width="1470" alt="Screenshot 2024-06-08 at 11 41 25 PM" src="https://github.com/SH20RAJ/sh20raj/assets/66713844/567560cc-2bec-45db-8f7a-27d88f3dde22">



Happy coding! 🚀