Normally, when you do git push [-u] <remote> <branch>
, git system will require you to authanticate by providing the username and password of your Git Hub account.
So, say I have cloned a remote repository from account01
git clone <url>
I do some work (add, modify, delete some files) and then I do
git add .
git commit -m "commit message"
Now, when I push
git push -u <upstream_name> <branch>
Note : -u
for upstream (I may be wrong!)
git will ask me to provide my account details in a form of username and password. After I have provided git with this information, the push instruction will commence.
EDIT 1
If you are trying to push to a remote repoistory located on account01 from account02, you may need to configure Collaborators on a remote repository located at account01. Simply
- Log in with your account
- Click on the remote repository you want to allow collaboration on
- Click on Settings
- Click on Collaborators
- Write your account02 username
- Click Add collaborator
- Go to your email address which you used to create account02
- Accept collaboration request
At this point you will be able push directly to this remote repository from account02