Git Push Changes to Remote
Use the git push command to copy local changes (Committed changes) to the remote git repository.
Syntax:
Git Push Example
After committing all the new files or updated files, You can push your changes to the remote git repository using the “git push” command.
- The default remote repository is referred to as the origin. You can find this with
git remote -v
command. - The default branch is used, master. You can find the current active branch with
git branch
command.
The above command will upload all changes to the origin remote repository under the master branch.
You can use the above command like below. Without branch name and origin, git push will use origin by default and it pushes our current active branch to the origin remote.
Running example of git push command:
Git Push Other Branches
You are working on a different local branch named “develop”. You can push changes of develop branch to remote develop branch by executing the command:
Make sure you are on develop branch using git branch
command.
In some cases, you may require to push your local branch to a remote branch with a different name. You can do this by specifying remote branch:
0 Comments
CAN FEEDBACK
Emoji