Skip to main content

Add your git commits from your corporate account to your private profile with gitmerge.

Project description

GitMerge

As many developers have to use a separate Git account during work, a large amount of their work is not tracked in their personal profile which is often a good reference on resumes etc. GitMerge solves this problem by importing meta data of your work commits to a dummy repo in your private Git account.


Installation

Easiest way:

pip install gitmerge

Or you can also install it from source. For development clone the repo and install it with -e flag.

git clone git@github.com:bensch98/git-merge.git
cd git-merge
pip install -e .

If you have nice ideas, feel free to open a PR.


Usage

The easiest way to use this package is via its CLI.

gitmerge merge --author [GIT_NAME] --src [SOURCE_REPO] --dest [DESTINATION_REPO] --company [COMPANY_NAME] --since 2021-12-31 --until 2022-01-10

Flags:

  • --author: Your Git username which was used for the commits. Only commits of this account will be merged into the destination repo.
  • --src: Relative path to the source repository from which you want to import the commits.
  • --dest: Relative path to the destination/dummy repository where the commits will be imported into. For each repository a directory and file will be created where meta data of the commits will be stored.
  • --company: The name of the company which owns the repository. Can be omitted in the future.
  • --since: Specifies from where on the commits should be taken into account. Can be specified as date (2021-09-30, 2021/09/30, 2021-9-1, 2021/9/30, ...) or as a delta value.
  • --list: Can be used to view the commits which would be committed and pushed without this flag. It does nothing despite printing out the commits to the terminal.

For more help use the --help flag of the CLI.

Examples for --since flag:

  • 1y: All commits of last year.
  • 1y3m: All commits of last 15 months.
  • 2w4d: All commits of last 2 weeks and 4 days (18 days).
  • 40d1y: All commits of last year and 40 days (405 days).
  • 0d: Only todays commits.

--since defaults to the last 7 days if nothing was specified. Each mode (y = year, m = month, w = week, d = days) defaults to 0 if omitted. Therefore 2d == 0y0m0w2d. --until default to current datetime

The package can also be imported and used like this.

from gitmerge.merge import Merger
m = Merger('USERNAME', '../PATH/TO/SOURCE/REPO', '../PATH/TO/DESTINATION/REPO', 'COMPANY_NAME')
commits = m.get_commits()
m.merge(commits)
m.push

TODOs

  • Documentation (README / Sphinx ?)
  • Unittests
  • Github Actions (workflows)
  • Command-line interface with click (more configuration options)

Help with these TODOs or good advice is greatly appreciated. For any questions open an issue.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitmerge-0.0.6.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitmerge-0.0.6-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file gitmerge-0.0.6.tar.gz.

File metadata

  • Download URL: gitmerge-0.0.6.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for gitmerge-0.0.6.tar.gz
Algorithm Hash digest
SHA256 ea66efeeac18955be8d3723042d2aded0b85a0512f026837a278ae96b1630ad4
MD5 3c63f82c26c293097ed17e75e4496d27
BLAKE2b-256 d46aefa1c3622830836d637f6a48b95ad9f2996f21f3ca4d466524a0234d5742

See more details on using hashes here.

File details

Details for the file gitmerge-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: gitmerge-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for gitmerge-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5af7e00246ce1fa28a8880f3efca25038752cfecc4fc93e9877c72329dd0e7ff
MD5 701baa4962d5eb97f4ac31cf3eae4307
BLAKE2b-256 729a41d44bb919f125fbb73dfbedbb08962adad3a014deea0232cc0280d1e700

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page