1.

What is the function of ‘GIT PUSH’ in GIT?

Answer»

‘GIT PUSH’ updates remote refs along with associated objects. The "push" COMMAND is widely used to publish any new local commits on a remote SERVER. The source (i.e. which branch the data should be uploaded from) is ALWAYS the currently checked out HEAD branch. The TARGET (i.e. which branch the data should be uploaded to) can be specified in the command's option. Sometimes we use below command :

git push origin master

  • push = push your changes to the remote server
  • origin = remote Server origin
  • master = Master branch

If you have other remote branches you have something like "git push origin test" then you push your changes to the test remote branch.

  • Just specifying
  • git push origin

will push every local branch that has a matching remote branch to that branch per DEFAULT. Not just the current branch. This is the same as using git push origin:



Discussion

No Comment Found