Skip to content

bhusal-rj/git-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is the simple git command that implements the basic git objects

Commands that are supported

init

Initializes the git object by creating the folders

hash-object

Hashes the given file and returns the SHA-1 encrypted 40 character token.

example usage

./git hash-object -w demo.txt

  • 8abf6b621d1b9baafe18f163d37a6736a63ae414

cat-file

It provides the content of the the hashed value that gets generated by the #hash-object

./git cat-file -p 8abf6b621d1b9baafe18f163d37a6736a63ae414

  • Returns the content Hello this is Rajesh Bhusal

ls-tree

List the contents of a given tree object in the working directory

./git ls-tree --name-only cf3cfbf46ea8b55baad6beec4463a9e1d2a0bb99 It returns all the files and folders of the current directory

write-tree

Creates a tree object from the current state here there is no stagging area so considering here all working directory is considered as stagging area

./git write-tree

It returns the 40 character long SHA 1 token of the current working directory

commit-tree tree_sha -m "Message"

Returns the information about the commit it gives information is

  • committed author name
  • Timestamp
  • Tree Sha
  • Parent Commit

It returns information like this

author Rajesh [email protected] 1713769157605 -345 committer Rajesh [email protected] 1713769157605 -345 Message

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published