GIT - 4.12 Manage files outside of GIT
We will rename and delete files outside of Git and see how it reacts. I am currently in my restitory and if I do a Git status, I am on the master with nothing in Commit since we have a clean work repertoire. I have cuckoo.html and Venus.html Create a file using the Touch command the file we will call it uranus.html by making an LS like this. We see that we have our Uranus file and we will use the MV Venus.html command the name of our current file, we will change it in Venus.txt This command is used to name a file if we make a ls -l, we see that we have our Uranus.html and Venus.txt, let's see how Git sees this. Although Git sees the files that I have changed not followed, it is not surprising but the name change is considered to be a deletion and the addition of a non -followed file. We must therefore be informed Git of our recent changes to simply have deletions we can use the parameter -u of the Git Add command. Git Add - U which means the update and press Enter. Now let's make a Git status, we now have our change to Commit which means that he has come to come. So to include both additions and deletions you must use the Git Add A capital letters. This will cover all the possible types of modification on the current work directory and will make its updates accordingly in the Git index. Now if I do a git status he will see correctly.html being renamed upon venus.txt and it also takes the new Uranus.html file still at this stage these modifications are only in the transit zone let's go from the Before with a commitment so let's give Git Commit -M and the name of our message which will be renamed and added like that. Here we determine that we do not really want Uranus.html we can use the bash RM command to delete the file at the operating system. So RM Uranus.html, now let's make a Git status he sees that the file has been deleted. Let's do a Git Add -u it will take the deletion and put in the transit zone, now let's make a commut, committee -m and the message, deletion of uranus.html, now this file has been deleted.