Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/theohbrothers/convert-foldertogitrepo
A script to convert ancient folder(s) into git repo(s).
https://github.com/theohbrothers/convert-foldertogitrepo
chronological convert file-metadata git old-files powershell pwsh repo script
Last synced: about 1 month ago
JSON representation
A script to convert ancient folder(s) into git repo(s).
- Host: GitHub
- URL: https://github.com/theohbrothers/convert-foldertogitrepo
- Owner: theohbrothers
- License: mit
- Created: 2021-07-19T09:59:30.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-10-08T16:18:20.000Z (over 2 years ago)
- Last Synced: 2023-03-07T01:06:51.905Z (almost 2 years ago)
- Topics: chronological, convert, file-metadata, git, old-files, powershell, pwsh, repo, script
- Language: PowerShell
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Convert-FolderToGitRepo
[![github-actions](https://github.com/theohbrothers/Convert-FolderToGitRepo/workflows/ci-master-pr/badge.svg)](https://github.com/theohbrothers/Convert-FolderToGitRepo/actions)
[![github-release](https://img.shields.io/github/v/release/theohbrothers/Convert-FolderToGitRepo?style=flat-square)](https://github.com/theohbrothers/Convert-FolderToGitRepo/releases/)A script to convert ancient folder(s) into git repo(s).
It is especially useful for converting old folders (possibly decade(s) old) into git repos, committing the files in chronological order they were created / modified (i.e. (using modified dates of files). That way, file metadata, especially date modified, is preserved in the `git log`. Optionally, allows specifying an override `git author`.
## How it works
Gathers all modified dates of descending files of a given folder. Starting from the earliest modified date:
- Does `git init`
- Does `git add` each file matching the modified date
- Does `git commit -m '[] Add files' --date --author `The date in the commit message is in [`ISO 8601`](https://www.iso.org/iso-8601-date-and-time-format.html) format in timezone `UTC+0`. You may want to modify the commit message to your liking.