💾 Archived View for gemlog.blue › users › zain › 1644942839.gmi captured on 2022-03-02 at 03:42:01. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

Learning git

Removing Files

Removing a file with command `rm file` from your working directory, it will be `unstaged`.

`git rm` will remove the file from your tracked files.

To keep the file in your working tree but remove it from your staging area, use the `--cached` option.

git rm --cached README

Moving Files

git mv file_from file_to

Equivalent form is:

mv README.md README
git rm README.md
git add README

Undoing Things

commit amend

The `git commit --amend` command modififes your latest commit. This command lets you change files in your last commit or your commit message. Your old commit is replaced with a new commit that has its own ID.

To change commit message:

git commit --amend -m "feat: Revised commit message"

To add modified file:

git commit --amend --no-edit