Push operation in HTML

Jerry modifies the previous commits using the git commit -a operation (signing changes) and he is ready to push the changes. Push operation saves permanent data to Git repository. After a successful push operation, other programmers can observe Jerry's changes.

He executes the git log command to observe commit details.

 [jerry @ CentOS project] $ git log 

The above command will produce the result:

 commit d1e19d316224cddc437e3ed34ec3c931ad803958 
Author: Jerry Mouse
Date: Wed Sep 11 08:05:26 2013 +0530

Changed return type of my_strlen to size_t

Before performing the push operation, he wants to review his changes, so he uses the git log command to browse the changes.

 [jerry @ CentOS project] $ git show d1e19d316224cddc437e3ed34ec3c931ad803958 

The above command will produce the result:

 commit d1e19d316224cddc437e3ed34ec3c931ad803958 
Author: Jerry Mouse
Date: Wed Sep 11 08:05:26 2013 +0530

Changed return type of my_strlen to size_t

diff --git a / string.cb / string.c
new file mode 100644
index 0000000.7da2992
--- / dev / null
+++ b / string.c
@@ -0,0 +1,24 @@
+ # include
+
+ size_t my_strlen (char * s)
+
{
+
char * p = s;
+
+
while (* p)
+ ++ p;
+ return (p -s);
+
}
+
+ int main (void)
+
{
+ int i;
+ char * s [] =
{
+ "Git tutorials",
+ "Tutorials Point"
+
};
+
+
+
for (i = 0; i <2; ++ i)
printf ("string lenght of% s =% lun", s [i], my_strlen (s [i]));
+
+
return 0;
+
}

Jerry is happy with his changes and is ready to push these changes.

 [jerry @ CentOS project] $ git push origin master 

The above command will produce the following result:

 Counting objects: 4, done. 
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 517 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To gituser@git.server.com: project.git
19ae206.d1e19d3 master -> master

Jerry's changes have been successfully pushed to the repository; Now other programmers can observe these changes by performing simulation or update operations.

According to Tutorialspoint

Previous article: Commit in Git

Next article: Update activity in Git

4.5 ★ | 2 Vote

May be interested

  • Update activity in GitPhoto of Update activity in Git
    tom performs the simulation operation and sees a new file string.c. he wants to know who added this file to the repository and for what purpose, so he runs the git log command.
  • Stash operation in GitPhoto of Stash operation in Git
    suppose you are implementing a new feature of your product. your code is in progress, suddenly a visitor. because of this, you have to go out for a few hours. you cannot commit this code and cannot throw it away at your changes. so you need some temporary space, where you can keep these local changes and then return to commit it.
  • Online Repository in GitPhoto of Online Repository in Git
    github is a social network for programmers for software development projects using git revision management system. it also has a standard gui application for direct download (windows, mac, gnu / linux) to your computer from web sites. but in this tutorial, we only consider the cli section.
  • Operating Rename in GitPhoto of Operating Rename in Git
    so far, both tom and jerry are using manual commands to compile their projects. now, jerry decided to create a makefile for the project and also put a name for the file string.c.
  • Delete operation in GitPhoto of Delete operation in Git
    tom updates the local repository and finds the compiled binary in the src directory. after observing the commit message, he realizes that this code is added by jerry.
  • Fixed a bug in GitPhoto of Fixed a bug in Git
    being human, everyone makes mistakes. so each vcs provides a feature to fix errors at some point. git provides a feature that we can use to undo the modifications made on the local repository.