Git – File Operations

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/git-file-operations/
PINTEREST
PINTEREST
INSTAGRAM

Normal file operations like deleting, moving, changing file name can be done in git.

Removing File

A tracked file can be removed liked below.

  • rm removes file

After remove operation and commit the file will be not tracked and exist for the future commits but exist in the history.

If the file is edited we need to force removal with the following command.

  • rm removes the specified file
  • -f forces for removal even if the file is edited

Moving Files

Unlike other vcs Git do not tracks files movements for reguler movement. To make  Git aware of the movement mv is used.

  • mv moves main.py to main2.py
RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/git-file-operations/
PINTEREST
PINTEREST
INSTAGRAM

LEARN MORE  Linux Lsof Command Tutorial With Examples

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)