├── changes.txt ├── it_works.png ├── get_a_job.jpg ├── README.md └── git_committed.py /changes.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /it_works.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Caparino/git_committed/HEAD/it_works.png -------------------------------------------------------------------------------- /get_a_job.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Caparino/git_committed/HEAD/get_a_job.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # git commit automation for $500k/yr jobs 2 | 3 | A Python script that creates 1-3 commits daily, at random times of the day, from a specified start date to today. This is perfect for generating a realistic Git history or simulating daily contributions for a GitHub streak. 4 | 5 | Inspired by [@Shogun89's fancy_job](https://github.com/Shogun89/fancy_job) 6 | 7 | ## Features 8 | 9 | - Automatically generates backdated commits from a specified start date to today, default start date is Jan 1st, 2024. 10 | - Ensures 1-3 commits per day with sequential timestamps to maintain a clean Git history. 11 | - Modifies a file (`changes.txt`) to include unique changes for each commit. 12 | - Commits include timestamps set using `GIT_AUTHOR_DATE` and `GIT_COMMITTER_DATE`. 13 | 14 | ## Setup 15 | 16 | 1. Clone this repository: 17 | 18 | ```bash 19 | git clone https://github.com/Caparino/git_committed 20 | cd git_committed 21 | ``` 22 | 23 | 2. Run the script to generate commits: 24 | 25 | ```bash 26 | python git_committed.py 27 | ``` 28 | 29 | 3. Add and push to your own repo since forks don't count for contributions: 30 | ```bash 31 | git remote -v 32 | 33 | git remote remove 34 | #eg. git remote remove https://github.com/Caparino/git_committed.git 35 | 36 | git remote add 37 | #eg. git remote add https://github.com/your_account/git_committed.git 38 | 39 | git push -u origin main 40 | ``` 41 | 42 | ## Usage 43 | 44 | The script will create 1-3 commits a day at random times for every day from your start_date (Jan 1, 2024 by default) to today. 45 | 46 | You can modify the script to use any start date, any range of random commits per day, or use a different file to store the number. 47 | 48 | By running this you will be able get a fancy streak on your github profile and get a job. 49 | 50 | ![How to get a job](get_a_job.jpg) 51 | 52 | ## Here's what it looks like in action 53 | ![Here's what it looks like in action](it_works.png) 54 | -------------------------------------------------------------------------------- /git_committed.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess 4 | from datetime import datetime, timedelta 5 | import random 6 | 7 | START_DATE = datetime(2024, 1, 1) 8 | 9 | def calculate_days_between(start_date): 10 | """ 11 | Calculate the number of days between the start date and today. 12 | 13 | :param start_date: The starting date 14 | :return: Number of days 15 | """ 16 | today = datetime.now() 17 | return (today - start_date).days 18 | 19 | 20 | def create_commits(start_date, file_name, commit_message): 21 | """ 22 | Create 2-3 sequential commits per day from the start date to today. 23 | 24 | :param start_date: Starting date for commits 25 | :param file_name: File to modify for creating changes 26 | :param commit_message: Base commit message 27 | """ 28 | # Calculate the total number of days 29 | num_days = calculate_days_between(start_date) 30 | 31 | for day in range(num_days + 1): # Include today 32 | current_date = start_date + timedelta(days=day) 33 | 34 | # Randomly decide the number of commits for the day (1-3) 35 | num_commits = random.randint(1, 3) 36 | 37 | # Generate random times for commits within the day 38 | commit_times = [] 39 | for _ in range(num_commits): 40 | random_hour = random.randint(0, 23) 41 | random_minute = random.randint(0, 59) 42 | random_second = random.randint(0, 59) 43 | commit_time = current_date.replace(hour=random_hour, minute=random_minute, second=random_second) 44 | commit_times.append(commit_time) 45 | 46 | # Sort commit times to ensure they are sequential 47 | commit_times.sort() 48 | 49 | # Create commits 50 | for i, commit_time in enumerate(commit_times): 51 | commit_date_str = commit_time.strftime("%Y-%m-%dT%H:%M:%S") 52 | 53 | # Modify the file to create changes 54 | with open(file_name, "a") as f: 55 | f.write(f"Commit on {commit_date_str} (Commit {i + 1} of {num_commits} for the day)\n") 56 | 57 | # Stage the changes 58 | subprocess.run(["git", "add", file_name]) 59 | 60 | # Create the commit with the backdated timestamp 61 | subprocess.run( 62 | [ 63 | "git", 64 | "commit", 65 | "-m", 66 | f"{commit_message} - {i + 1} on {commit_date_str}", 67 | ], 68 | env={ 69 | **subprocess.os.environ, 70 | "GIT_AUTHOR_DATE": commit_date_str, 71 | "GIT_COMMITTER_DATE": commit_date_str, 72 | }, 73 | ) 74 | 75 | print(f"Created commit on {commit_date_str}") 76 | 77 | 78 | def main(): 79 | # Start date 80 | start_date = START_DATE 81 | 82 | # File to modify 83 | file_name = "changes.txt" 84 | 85 | # Commit message base 86 | commit_message = "Sequential backdated commit" 87 | 88 | # Create commits 89 | create_commits(start_date, file_name, commit_message) 90 | 91 | 92 | if __name__ == "__main__": 93 | main() 94 | --------------------------------------------------------------------------------