Git Push Command


Git maintains local and remote branches for a codebase. A user creates a local copy of the central repository from the remote by using the git clone command. Upon completing a feature or new branch, a commit updates the local repository. The git push command sends the recent changes from local to remote so that other developers can get the updates by doing a git pull.

""</p

$ git push -u origin <branch_name>

The first time a branch is pushed, use git push origin, the command is necessary for pushing the new branch. After that, git push will work. Pushing changes in the same branch having a name as a working branch.

Git revert pushed a commit.