Search This Blog

Tuesday, October 5, 2010

Where is my git repository after pushing through an ssh tunnel?

Programmer Question

I've set my router at home to do port forwarding via SSH. I've succesfully cloned git repositories via:



git clone git+ssh://user@localhost:1234/repos local_repos


and then working locally, I can push and pull without trouble.



Now I'm in the situation where I created a project locally and I want to put it on my home machine. This is what I tried. On the home machine:



cd && mkdir new-project && mkdir new-project/.git
cd !$ && git --bare init


On the local machine:



mkdir new-project && cd new-project
git init
... (add, commit etc.)
git remote add origin origin git+ssh:/user@localhost:1234/home/user/new-project
git push origin master --tags


After giving my credentials, it seems to work happily. But if look on the home machine, I see nothing. A git status in /home/user/new-project yields an error.



Question: Where did my stuff get pushed too? (Or, what got pushed?)

Secondly: How can I achieve this when my tunnel is 'one way' so to speak?



Find the answer here

No comments:

Post a Comment

Related Posts with Thumbnails