The purpose of this project is to learn more about git internals and rust programming language.
The goal of this project is to imitate as possible git behaviours.
cargo install --git https://github.com/flomonster/my-git.git
The most useful command is my_git --help
which show you all possible commands.
You can also use it with a subcommand, for instance my_git switch --help
.
Note that you can configure my_git both locally and globally.
$ my_git config --global user.name "John Doe"
$ my_git config --global user.email "[email protected]"
$ cd my-awesome-project/
$ my_git init # This command generates a .my_git directory
$ my_git add src/some_file.rs
$ my_git add src/some_directory/
$ my_git status
Changes to be committed:
new file: src/some_directory/.gitkeep
new file: src/some_file.rs
Untracked files:
(use "git add <file>..." to include in what will be comitted)
.my_gitignore
$ my_git commit -m "A message"
$ my_git branch feature # Create a new branch
$ my_git branch # Show all branches
* master
feature
$ my_git switch feature # Switch branches
$ my_git branch -d master # Delete a branch