JIT is a simple version control system implemented in Go. It allows you to track changes to your files and collaborate with others.
- Track changes to files
- Commit changes with messages
- View commit history
- Revert to previous versions
- Clone the repository
git clone https://github.com/MwauratheAlex/jit_vcs.git
cd jit_vcs
- Resolve dependancies
go mod tidy
- a. Install jit globally(requires go installed)
go install
- ensure your $PATH includes go binaries directory (default is $HOME/go/bin or $GOBIN) You can verify this with:
echo $PATH
- if the directory is not in your $PATH, add it. Example in bash
export PATH=$PATH:$(go env GOPATH)/bin
- b. Alternatively, build the JIT binary
go build -o jit main.go
- this will create an executable jit binary in the current directory
- Copy it to a directory in your $PATH to use globally
cp jit /usr/local/bin/
or Run it directly from any directory.
./jit
go test ./command
mkdir new_repo # create new_repo directory
cd new_repo # change into the new_repo directory
jit init # Initialize Repository
jit add file1 file2 README.md
- add the files to .jitignore
echo file2 .jitignore
jit commit -m "Your commit message"
jit log
jit diff <old-commit-hash> <new-commit-hash>
jit branch <branch-name>
jit branch
jit checkout <branch-name>
jit merge <branch-name>
jit clone <repo-to-clone> <destination-folder>
- incase of merge conflicts, conflict markers are added to the file
- Conflict resolution is not implemented yet
- Example file with conflicts after merge
# jit testing
Here I'm just testing JIT.
Two lines added in readme
one more commit
one last commit
<<<<<<< HEAD
One more thing
add in master now
=======
One more thing
>>>>>>> target_branch
Create a .jitignore
file and list the full paths of the files you want to ignore
Example .jitignore
git.c
secret.txt
- This files will be automatically ignored during jit operations.
- jit also ingores .jit folder and .jitignore itself.
- this means that the .jitignore folder will not be copied during cloning.
and in other relevant operations like
jit add <file> ...
- Needs more comprehensive testing
Contributions are welcome! Please fork the repository and submit a pull request.
For any questions or feedback, please contact [email protected].