Vault
Vault will be a command line tool (if successful) similar to git which would have multiple features like brances etc etc.
__ __ _ _
\ \ / /_ _ _ _| | |_
\ \ / / _` | | | | | __|
\ V / (_| | |_| | | |_
\_/ \__,_|\__,_|_|\__| , simplified version control for local files
Info
This is my try at learning Rust. I literally even had to ask ChatGPT on how to start a new Cargo project while starting this : ) . I don't even know if I would even be able to pull this off. Lets hope for the best.
Idea
So basically, something like vault init
should initialize a vault repository in the current working directory. Then comes the actual git part -
vault init
would initially start amain
branch in the.vault
folder. This would create something like amain
directory inside./vault
.- Every file in the present working directory would be present in a directory inside
main
(branch) maybe by a encoded name to prevent collissions. - Whenever user runs
vault add
in the present working directory, would be looped, and added to the current branch. - These files would be compressed by maybe some library or algorithm to keep the project memory efficient.
- If a user creates a new branch by say
vault create {branch_name}
, a new folder with the branch name would be created alongside themain
folder depicting the new branch. - By default, whenever a new branch is created, the contents of the current branch should be copied over to the new branch.
- Each branch should be independent of each other, and whenever the user switches branches by say
vault switch {branch_name}
all the files would be overwritten according to the new branch. - MAYBE LATER IF WE REACH TILL HERE , we can add the functionality of deleting a branch, merging two branches etc.
Hmm :/, Enough talking, lets start!
Set Up Locally
-
Clone this repository by running the command
git clone https://github.com/shubhexists/vault
. -
cd
into the directory and runcargo build --release
. This will create binaries for the project. -
Open a new terminal and open
.bashrc
in your favourite editor, saynano ~/.bashrc
. -
Export the path of the executable (It is in the
/target/release/
directory .) For eg, it wasexport PATH="$PATH:/home/jerry/Desktop/vault/target/release"
for me. -
Save the file and source the terminal or simple open a new terminal instance.
-
You are not all set to "VAULTIFY" your local files :)