A VCS (Version Control System) built on the same core principles as Git.
- Initialize a trail repository. Run
trail init - Commit the project with a message. Run
trail commit 'commit_description' - View Commit history. Run
trail log --oneline - Revert back to any commit in history. Run
trail revert 'commit_id' - Compresses the file contents before storing them
- It hashes the content of each file and sets that hash as the title of that file after it is compressed.
- Now, it also supports nested files and folders (stores history for all the nested files/folders).
- Push your code to GitHub seamlessly.
- Pull code from GitHub
- You run
trail init, it initializes an empty trail repository. - When you have completed a specific feature of your project, run
trail commit 'commit_desc'to save a snapshot of current state of your project in history. - Stores the current state of your project in
.trail/history.jsonfile. - View commit history by
trail log --oneline. - If you want to go back to a specific commit in history, just run
trail revert 'commit_id". (Get commit id by running 'trail log --oneline') - Push code to GitHub using
trail push owner/repo --token GITHUB-PAT --branch main - Pull code from GitHub using
trail pull owner/repo --token GITHUB-PAT --branch main
How to generate a GitHub Personal Access Token (PAT):
- Go to Settings > t; Developer Settings > t; Personal Access Tokens > t; Tokens (classic) (or Fine-grained tokens).
- Click Generate new token.
- Give your token a Note (description) and set an Expiration period.
- Select the required scope (
repo)- Click Generate token at the bottom.
- Copy and save your token immediately — GitHub will not show it to you again!
All the history of your project is stored in a .trail folder. The structure of .trail is:
my-project/
│
├── .trail/
│ ├── compressed/
│ └── history.json
│
├── file1.js
├── package.json
└── ...
─ ...
history.json stores metadata for every commit.
Each commit contains:
- Commit ID
- Commit message
- Date
- Mapping of project filenames to compressed file hashes
{
"commitId": "...",
"parentId": "...",
"commitDesc": "Added authentication",
"date": "...",
"files": {
"index.js": "af82bd73...",
"src/app.js": "b17de09a..."
}
}
}