Steps to push from a Local Branch to a Remote Branch on Github
I will list the steps below and what it does
- First off, you must have created your own branch off the main branch (if you need tips on how to do this, check my post here)
- So let's say for example your new branch's name is wemis_branch, which is the name I will be using to illustrate this whole process. Once you are done editing or making changes to your new branch and you are ready to push to the remote, go ahead and follow the following steps below.
Step 1:
- This is to confirm and double-check that you are on the right branch that you desire to push to the remote
*wemis_branch
main
Note
From the example above, the asterisk branch shows the branch that I'm currently working on.
Step 2:
Once you have confirmed that you are on the right branch, pull from the origin just to be sure that your branch is up to date (you may not be the only one working on that branch and a couple of changes might have occurred since your last pull)
Step 3:
- Next is a git status, which will show a list of the files that have been modified or changed and are ready to be committed (at this point you can decide if you want to add a specific file or add all the files)
Step 4:
- If you are adding specific files, you have to watch out for the path and ensure that it is written correctly
e.g:-
- If you want to add all the files that you have made changes to, use
Step 5:
- The next step is to commit with a quick note on what changes you made
Step 6:
- The last step is to push to the remote branch
These are the steps that are required to push from your local branch to a remote branch. Once you have been able to complete all these steps successfully, you can then go to your GitHub page, search for the specific repository that you are working on, and also search for the new branch that you just pushed in.
Once you have confirmed that it has been pushed to the remote, you can then go ahead and send a pull request or just keep working on that branch if you still need to make changes
Yeah, these are the simple steps to push from a local branch to a remote branch on GitHub. I will be coming here from time to time as well until I fully get a hang of it. That will be all from me today. See you soon.
HAPPY CODING!!! ❤️