Create a local repositry

How to create .git in local reposity and commit your files

  1. Create a folder .git:

    git init
  2. Include all files:

    git add .
  1. Verify the status

    git status
  2. Commit files

    git commit -m "my first commit"
  3. Redirect to Branch Main

    git branch -M main
  4. Link your local repository to your remote GitHub repository You can create and find your Git remote here:

    git remote add origin git@github.com:{usergithub}/{project}.git
  5. Upload your files to branch main

    git push -u origin main
  1. Delete the commit while keeping the code.

    git reset --soft + "commit"
  2. Remove the staging-area while keeping the code.

    git reset --mixt + "commit"
  3. Remove a Commit

    git reset --hard
  4. Save what was deleted with the last version of the commit

    git reset --hard + "commit"

✨ Ready.