Git and Github Tutorial - Making changes to files - Part 5

Hi, Today in iThePro we will learn how to use Git and how to use with Github to build software and develop it. In this part we will see how to Making changes to files.


Adding and Editing Files:
Each time you add or editing files, Git will realise that. And to to find out Git Status Command will help for that.

Viewing Changes with diff:

git diff <file-name>
Git use diff unix based command to showing the different of modification between the Project and the Repository.
git diff --staged <file-name>
This command will showing the different of modification between the Staged Index and the Repository.
git diff [--staged] --color-words <file-name>
This Command will give a nice and simple output with colour.

Deleting Files:
git rm <file-to-delete>
git commit  -m "File deleted"
This how we do once we want to delete files from our repository.

Moving and Renaming files:
git mv <file1> <file2>
Or
git mv <file1> <directory/file1>
git commit -m "Moving and Renaming"
This how we do once we want to move or rename files.



See the Git and Github Tutorials.


Author

OUSSAMA AMRI

Oussama Amri 21 years, security professional from Tunisia. Lover of computer science especially programming and secuirty. Follow me On :

Popular Posts

iThePro.com. Powered by Blogger.