简体   繁体   中英

How can I merge my local branch with my remote branch on my server?

I want to merge my local branch with the branch on my server. On my local computer I navigate to my project folder and then type:

git remote add origin ssh://myuser@myhost:22/html/myproject

But I get the error message:

external Repository origin already exists

So I tried to use another branch name:

git remote add testbranch ssh://myhost@myuser:22/html/myproject

and then

git push testbranch master

and then I get the error message:

fatal: '/myproject' does not appear to be a git repository fatal: Could not read from Remote-Repository. Please ensure that the correct access permissions exist and the repository exists.

I checked /myproject with git status, it is a git repository. The permission rights of the folder are 775.

external Repository origin already exists

Then the command to use would be:

git remote set-url origin ssh://myhost@myuser/html/myproject

But for that, you would need abare repository in /html/myproject , which it is probably not .

Initializing a bare repository, and adding a post-receive hook is usually the way to updtae /html/myproject content.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM