Stolen Git

Have you ever wanted to use Git but it's too good?


What is stolen git? \ Why?

Stolen git is well... you get it. I'm building a mini git clone to learn version control and get comfortable with ruby.

Usage

Command description Flags
init Initialize the project N/A
stage add a file or directory to be tracked N/A
commit Save the current tracked state -n [--name]
-d [--description]
diff get the difference between working directory and the last commit N/A
log print out commit history (limit print by a number log <number>) N/A

| reset | Reset to the last commit | N/A | | checkout | check a commit or a branch without loss in data | -c [--commit] <commit_id> to check out a commit instaed of a branch wihout changing HEAD pointer | | branch | List all branches. (or creating a branch by branch <name>) | N/A |

Installation

  1. Make sure you have Ruby installed on your system. You can check by running:
   ruby -v

(If you don't have Ruby, visit ruby-lang installation to get set up.)

  1. Install the Gem
    Run the following command in your terminal:
   gem install stg

Run stg to verify your installation

Examples

[!NOTE] You have to initialize with stg init for any of the other commands to work

  • Initialization
  stg init
  • Staging
  stg stage src/page.ts
  • Committing
  stg commit -n "Adding main page"
  • Logging all commits
  stg log

Logging last 5 commits

  stg log 5
  • Help
  stg
  or
  stg help
  • Hard reset

stg