Skip to content

Latest commit

 

History

History
94 lines (60 loc) · 3.45 KB

File metadata and controls

94 lines (60 loc) · 3.45 KB

Frame 4 bit is a version control system inspired by Git. The main inspiration came from 'Pro Git', a book by Scott Chacon (one of the co-founders of GitHub). The 'internals' section of the book provided insightful information about the internal workings of Git and has been a deciding factor in the development of the core workings of Bit.

Commands

  1. init

    initialize a directory as bit directory

    bit init .
    
  2. status

    check the status of current working directory and staging area

    bit status
    
  3. add

    add files, changes to staging area inorder to make them ready to commit

    to select all the files

    bit add .
    

    for single files

    bit add <filename>
    
  4. rm

    --cached is used to remove from just staging area

    bit rm --cached .
    

    to select single files

    bit rm --cached <filename>
    

    to remove from both staging area and working directory use the following command

    bit rm <filename>
    
  5. Restore

    restore the file from staging area to working directory

     bit restore --staged <filename>
    

    restore the file changes from previous commit descarding the current changes

    bit restore <filename>
    
  6. commit

    commit the files in staging area

    bit commit -m "<COMMIT_MSG>"
    
  7. branch

    create a branch

    bit branch <BRANCH_NAME>
    

    view branches or view active branch

    bit branch -a
    
  8. checkout

    switch between branches

     bit checkout <BRANCH_NAME>
    

Working of commands

Following information provides just a bird's eye view of how commands are working and it is a bit simplified inorder to make it easy to understand.

Status Command

directory structure Status 1 Status 2 Status 3 Status 4 Status 5 Status 6

Add Command

Add 1

Commit command

Commit 1 Commit 2 Commit 3

Branch command

Branch 1

Checkout command

Checkout 1 Checkout 2 Checkout 4