Home > Mobile >  Is it necessary to push your commit files from a new branch?
Is it necessary to push your commit files from a new branch?

Time:07-07

I created a new branch to work on so I can improve my app and therefore made a new branch. As you all know, you need to commit your changes to your new branch so it won't affect your main branch.

My question is do you have to push your commits from your new branch at all and if you do push your commits what will it do? Also, why would you want to push your commits from your new branch?

CodePudding user response:

You don't have to do anything.

You are working with a Git repository on your computer (called the "local"). The notion "push" implies that you have some other Git repository in some other location (called the "remote") that you want to keep synchronized with the one on your computer; GitHub is an example of another location of that sort.

You might have a remote in order to share your code with others, or simply as a way of backing up your work to another machine in case your machine has an issue. But if neither of those things is the case, then you probably have to reason to have a remote, so there is nothing to push to and you shouldn't worry about it.

  • Related