Skip to content

Instantly share code, notes, and snippets.

@cdhiraj40
Last active October 13, 2023 09:54
Show Gist options
  • Select an option

  • Save cdhiraj40/41cc368cd76b2dfec38a413f8f11c1a6 to your computer and use it in GitHub Desktop.

Select an option

Save cdhiraj40/41cc368cd76b2dfec38a413f8f11c1a6 to your computer and use it in GitHub Desktop.

Revisions

  1. cdhiraj40 revised this gist Oct 13, 2023. No changes.
  2. cdhiraj40 revised this gist Dec 9, 2022. 1 changed file with 56 additions and 1 deletion.
    57 changes: 56 additions & 1 deletion git-basics.md
    Original file line number Diff line number Diff line change
    @@ -5,4 +5,59 @@
    ### Git Download link
    https://git-scm.com/downloads

    ### Git Commands
    ### Git Commands - 1

    1. Run `git init` command
    ```
    git init
    ```

    2. Run `git status` command
    ```
    git status
    ```

    3. Add a specific file to staging area.
    File path should be relative to your project's path
    - **Correct path => src/lib.rs**
    - **Wrong** path => user/windows/my-cool-project/src/lib.rs
    ```
    git add <file path>
    ```

    4. Run `git commit`
    Replace commit message with a small message which is descriptive of the changes. Make sure its small and on-point.
    ```
    git commit -m <commit message>
    ```

    5. git log
    ```
    git log
    ```

    6. git stash
    ```
    git stash
    ```

    ------

    ### Git Commands - 2

    1. Connect remote repository with local one.
    Specify a `remote name` which you would like to have and replace link with your remote project link.
    ```
    git remote add <name> <link>
    ```

    2. Verify new remote
    ```
    git remote -v
    ```

    3. Push the changes from local to remote.
    ```
    git push
    ```
    -----
  3. cdhiraj40 revised this gist Nov 26, 2022. 1 changed file with 8 additions and 1 deletion.
    9 changes: 8 additions & 1 deletion git-basics.md
    Original file line number Diff line number Diff line change
    @@ -1 +1,8 @@
    ## Git Basics
    ## Git Basics

    > Note: The whole talk flow is mentioned here: https://talks.cdhiraj40.dev/git-basics/talk-content.html
    ### Git Download link
    https://git-scm.com/downloads

    ### Git Commands
  4. cdhiraj40 created this gist Nov 26, 2022.
    1 change: 1 addition & 0 deletions git-basics.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ## Git Basics