Creating a new remote for a local repository

1,864 views
Skip to first unread message

Edward Diener

unread,
Dec 8, 2013, 3:07:29 PM12/8/13
to tortoise...@googlegroups.com
I have a local repository created originally by cloning a particular remote repository. I create a new branch for the local repository successfully in TGIT. Since I do not have write permission to 'push' my changes to the remote repository from which my repository was cloned, I created a new repository on GitHub in order to share my changes with someone else. The new repository is created with a 'master' branch and a single readme.md file is committed to it.

Then in the TGIT sync dialog I use the Remote URL: Manage button to create a remote under another name with its own URL pointing to the GitHub repository I just created. Now I try to push my local repository to my new remote repository's master branch. What I get from TGIT is the message:

'Don't know what will push because unknown branch "myremote/master"'

If I try to look ate all my remotes by clicking the ... button to the right of the Remote Branch: in the sync dialog it only shows the remotes from the originally cloned repository and does not show the remote "myremote/master" from my new GitHub repository.

How do I get TGIT to recognize my new remote so I can push to it.

b873...@student.nsysu.edu.tw

unread,
Dec 10, 2013, 2:27:50 AM12/10/13
to tortoise...@googlegroups.com

Edward Diener

unread,
Dec 10, 2013, 3:17:04 PM12/10/13
to tortoise...@googlegroups.com
On Tuesday, December 10, 2013 2:27:50 AM UTC-5, b873...@student.nsysu.edu.tw wrote:

That worked. Thanks ! It seems strange that tgit only recognizes the remote after you push to it, but I guess there must be some reason for that.
 

b873...@student.nsysu.edu.tw

unread,
Dec 10, 2013, 8:03:31 PM12/10/13
to tortoise...@googlegroups.com
You should do the Fetch after adding the remote, 
so that the local repository get remote ref. from remote repository 
and show you the remote branch(es).

P.S
If use Context Menu, TortoiseGit -> Settings / Git / Remote, to add the remote, 
Then TGit will show you a message dialog "Do you want to fetch remote branches from the newly added remote?".
Usually, push "Yes" button at that moment.


Edward Diener於 2013年12月11日星期三UTC+8上午4時17分04秒寫道:
Reply all
Reply to author
Forward
0 new messages