Giter VIP home page Giter VIP logo

git-rs's Introduction

git-rs

git rust version

Roadmap

  • Setup project
  • Git init
  • Git add
  • Git status (display modifications not staged and untracked files in the future)
  • Git commit
  • Git log
  • Git revert
  • Git branch
  • Git checkout

Compile

cargo build

Test

cargo test

Run git-rs Command

Help

./target/debug/git-rs help                                                                                                                     

Usage: git-rs <COMMAND>

Commands:
  init
  add
  help  Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help

Init

./target/debug/git-rs init  

Initialized empty Git repository in /Users/chenjing/work/study/ruststudy/git-rs/.git-rs

Add

> touch v1 v2 v3
> ./target/debug/git-rs add README.md src/cmd.rs v1  

Status

./target/debug/git-rs status                                                                                                                   
=== Branches ===
*main

=== Staged Files ===
README.md
src/cmd.rs
v1

=== Removed Files ===

=== modifications not staged for commit ===

=== untracked files ===

Commit

./target/debug/git-rs commit "first commit test"

./target/debug/git-rs status     
=== Branches ===
*main

=== Staged Files ===
=== Removed Files ===

=== modifications not staged for commit ===

=== untracked files ===

Log

./target/debug/git-rs log
===
commit 4e8a0324b3e1fa9ed8f231e4cb7a2c2192993aa6
Date: Tue Mar 28 23:44:53 2023 +0000
remove v1



===
commit 1fb6db29a778fb16ef850d299f8f38dbf72668f5
Date: Tue Mar 28 23:44:26 2023 +0000
first commit test



===
commit 992f1e2eb8d68f9aa4bbb30f722de1f818831bc7
Date: Tue Mar 28 23:44:14 2023 +0000
initial commit

Demo

asciicast

git-rs's People

Contributors

jingchen2222 avatar

Watchers

 avatar

git-rs's Issues

support git checkout file and branch

When you open an issue for a feature request, please add as much detail as possible:

  • A descriptive title
  • A description of the problem you're trying to solve, including why you think this is a problem
  • An overview of the suggested solution
  • If the feature changes current behavior, reasons why your solution is better

See here for more detail on what is expected of a feature request.

Descriptions:

Checkout file

Takes the version of the file as it exists in the head commit and puts it in the working directory, overwriting the version of the file that’s already there if there is one. The new version of the file is not staged.

Checkout commit_id file

Takes the version of the file as it exists in the commit with the given id, and puts it in the working directory, overwriting the version of the file that’s already there if there is one. The new version of the file is not staged.

Checkout branch

Takes all files in the commit at the head of the given branch, and puts them in the working directory, overwriting the versions of the files that are already there if they exist. Also, at the end of this command, the given branch will now be considered the current branch (HEAD). Any files that are tracked in the current branch but are not present in the checked-out branch are deleted. The staging area is cleared, unless the checked-out branch is the current branch (see Failure cases below).

support git branch cmd

Before you open an issue, please check if a similar issue already exists or has been closed before.

When you open an issue for a feature request, please add as much detail as possible:

  • A descriptive title
  • A description of the problem you're trying to solve, including why you think this is a problem
  • An overview of the suggested solution
  • If the feature changes current behavior, reasons why your solution is better

See here for more detail on what is expected of a feature request.

Description

Add git branch cmd

display untracked file for `git status`

When you open an issue for a feature request, please add as much detail as possible:

  • A descriptive title
  • A description of the problem you're trying to solve, including why you think this is a problem
  • An overview of the suggested solution
  • If the feature changes current behavior, reasons why your solution is better

See here for more detail on what is expected of a feature request.

Description

The final category (“Untracked Files”) is for files present in the working directory but neither staged for addition nor tracked. This includes files that have been staged for removal, but then re-created without git-rs knowledge.

support git status showing modified but not staged files

When you open an issue for a feature request, please add as much detail as possible:

  • A descriptive title
  • A description of the problem you're trying to solve, including why you think this is a problem
  • An overview of the suggested solution
  • If the feature changes current behavior, reasons why your solution is better

See here for more detail on what is expected of a feature request.

Description

A file in the working directory is “modified but not staged” if it is

  • Tracked in the current commit, changed in the working directory, but not staged; or
  • Staged for addition, but with different contents than in the working directory; or
  • Staged for addition, but deleted in the working directory; or
  • Not staged for removal, but tracked in the current commit and deleted from the working directory.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.