-1

I have created local branch:

git checkout -b tmp1

Now I would like to push this branch to server:

git push remote_tmp1 tmp1

Got error:

fatal: 'remote_tmp1' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

How to push my branch to server?

vico
  • 13,725
  • 30
  • 108
  • 237

3 Answers3

0

The git push syntax is:

git push <remote-name> <branch-name>

Therefore, replace your <remote-name> with the name of your remote (probably origin if you cloned from it).

If you don't know its name, just like them using git remote

blue112
  • 41,908
  • 3
  • 40
  • 53
0

This is very simple:

git push origin tmp1
Masood
  • 159
  • 5
0

You are getting that specific error because you have not added remote_tmp1 as a remote repository.

Add the remote repository first and then retry pushing: git remote add remote_tmp1 https://remoteserver.com/repository.git git push --set-upstream remote_tmp1 tmp1

You can add the remote using https as above or with ssh if available. For example if you're using Github you can use either: https://github.com/username/repository.git or git@github.com/username/repository.git.

djrollins
  • 170
  • 1
  • 10