Git Update Operation - Git (software)

What is Git Update Operation?

Modify Existing Function

Tom plays the clone operation and reveals a new file string.c. He wants to know who introduced this file to the repository and for what cause, so, he executes the git log command.

The above command will produce the following result:

The Clone operation will create a new listing in the present day operating listing. He adjustments the directory to newly created listing and executes the git log command.

The above command will produce the following result:

After observing the log, he realizes that the file string.c changed into introduced by way of Jerry to implement simple string operations. he's curious about Jerry’s code. So he opens string.c in text editor and at once finds a bug. In my_strlen feature, Jerry is not the use of a constant pointer. So, he decides to regulate Jerry’s code. After change, the code looks as follows:

The above command will produce the following result:

After testing, he commits his change.

The above command will produce the following result:


Tom uses git push command to push his changes.


The above command will produce the following result:

Add New Function

meanwhile, Jerry decides to implement string compare functionality. So he alters string.c. After change, the file appears as follows:

The above command will produce the following result:

After testing, he is ready to push his change.

Before push operation, he verifies commit by viewing log messages.

Jerry is happy with the changes and he wants to push his changes.

The above command will produce the following result:

But Git is not permitting Jerry to push his adjustments. because Git recognized that remote repository and Jerry’s local repository are not in sync. due to this, he can lose the records of the project. To avoid this mess, Git failed this operation. Now, Jerry has to first replace the local repository and only thereafter, he can push his own adjustments.

Fetch Latest Changes

Jerry executes the git pull command to synchronize his local repository with the remote one.

The above command will produce the following result:

After pull operation, Jerry assessments the log messages and finds the information of Tom’s commit with commit identity cea2c000f53ba99508c5959e3e12fff493ba6f69

The above command will produce the following result:

Now, Jerry’s local repository is fully synchronized with the remote repository. So he can properly push his adjustments.

The above command will produce the following result:

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Git (software) Topics