# GIT: How to upload Rails project using GIT

**URL:** <https://www.ruby-forum.com/t/git-how-to-upload-rails-project-using-git/190923>\
**Category:** Rails\
**Created:** [June 30, 2010, 10:11pm UTC](https://www.ruby-forum.com/t/git-how-to-upload-rails-project-using-git/190923 "2010-06-30T22:11:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aliibrahim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19b73/32.png) [@aliibrahim](https://www.ruby-forum.com/u/aliibrahim)\
**Post date:** [June 30, 2010, 10:11pm UTC](https://www.ruby-forum.com/t/git-how-to-upload-rails-project-using-git/190923/1 "2010-06-30T22:11:51Z")

</div>

I installed

- gem install git

- sudo apt-get install git-core

- cd to folder where my application “demo” is

- /home/ruby/

- git init

- git status

- git add .

- git commit -m “First V”

- git config --global user.name “Ali I.”

- git config --global user.email "removed\_email\_address@domain.invalid

now i am running

git push origin master

and getting error of host and port 22

how to fix this error.

---

<div class="post-metadata">

**Author:** ![aliibrahim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19b73/32.png) [@aliibrahim](https://www.ruby-forum.com/u/aliibrahim)\
**Post date:** [June 30, 2010, 10:27pm UTC](https://www.ruby-forum.com/t/git-how-to-upload-rails-project-using-git/190923/2 "2010-06-30T22:27:50Z")

</div>

Ali I. wrote:

> I installed
> 
> - gem install git
> 
> - sudo apt-get install git-core
> 
> - cd to folder where my application “demo” is
> 
> - /home/ruby/
> 
> - git init
> 
> - git status
> 
> - git add .
> 
> - git commit -m “First V”
> 
> - git config --global user.name “Ali I.”
> 
> - git config --global user.email "removed\_email\_address@domain.invalid
> 
> now i am running
> 
> git push origin master
> 
> and getting error of host and port 22
> 
> how to fix this error.

This is a Git issue, not a Rails issue. Please ask on a Git forum.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![aliibrahim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19b73/32.png) [@aliibrahim](https://www.ruby-forum.com/u/aliibrahim)\
**Post date:** [June 30, 2010, 10:30pm UTC](https://www.ruby-forum.com/t/git-how-to-upload-rails-project-using-git/190923/3 "2010-06-30T22:30:20Z")

</div>

Ali I. wrote:

> I installed
> 
> - gem install git

Wow. I didn’t even know there was a git gem. What is that some Ruby  
wrapper for Git? Very interesting. I’ll have to look into what this is  
about.

> - sudo apt-get install git-core
> 
> - cd to folder where my application “demo” is
> 
> - /home/ruby/
> 
> - git init
> 
> - git status
> 
> - git add .
> 
> - git commit -m “First V”
> 
> - git config --global user.name “Ali I.”
> 
> - git config --global user.email "removed\_email\_address@domain.invalid
> 
> now i am running
> 
> git push origin master

You didn’t list where you added the “origin” remote to your repository.  
Did you do that?

git remote show origin

What does that tell you about the remote named “origin?”

If you don’t have an “origin” remote then add one with:

git remote add origin \<url\_to\_repository\>

> and getting error of host and port 22
> 
> how to fix this error.

Git needs to know where to push to. A remote named “origin” should  
contain that information.

If you clone an exiting repository then Git will kindly add the “origin”  
remote for you, which points back to the original repository. But, if  
you create a new repository then there is no origin, which should be  
kind of obvious.

---

<div class="post-metadata">

**Author:** ![aliibrahim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19b73/32.png) [@aliibrahim](https://www.ruby-forum.com/u/aliibrahim)\
**Post date:** [June 30, 2010, 11:39pm UTC](https://www.ruby-forum.com/t/git-how-to-upload-rails-project-using-git/190923/4 "2010-06-30T23:39:39Z")

</div>

Yes i did the same thing through out

i have apache2 on ubuntu

when i run git push origin master

instead of

mysshid@256.256.256.256

it took me to for password

ali@256.256.256.256

here i am stuck

i look at the apache config and i set the globaluser name for git but  
it did not work

---

<div class="post-metadata">

**Author:** ![aliibrahim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19b73/32.png) [@aliibrahim](https://www.ruby-forum.com/u/aliibrahim)\
**Post date:** [June 30, 2010, 11:51pm UTC](https://www.ruby-forum.com/t/git-how-to-upload-rails-project-using-git/190923/5 "2010-06-30T23:51:22Z")

</div>

Ali I. wrote:

> i look at the apache config and i set the globaluser name for git but  
> it did not work

I think you’ve gone completely off-topic at this point. You really need  
to take this to an appropriate Git forum.

---

<div class="post-metadata">

**Author:** ![aliibrahim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19b73/32.png) [@aliibrahim](https://www.ruby-forum.com/u/aliibrahim)\
**Post date:** [June 30, 2010, 11:20pm UTC](https://www.ruby-forum.com/t/git-how-to-upload-rails-project-using-git/190923/6 "2010-06-30T23:20:20Z")

</div>

On 30 Jun 2010, at 22:30, Robert W. wrote:

> you create a new repository then there is no origin, which should be  
> kind of obvious.

… meaning that if you just want to use Git on your own computer and  
not push to a “central” repository, you just use “git commit”.

---

<div class="post-metadata">

**Author:** ![aliibrahim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e19b73/32.png) [@aliibrahim](https://www.ruby-forum.com/u/aliibrahim)\
**Post date:** [July 1, 2010, 11:44pm UTC](https://www.ruby-forum.com/t/git-how-to-upload-rails-project-using-git/190923/7 "2010-07-01T23:44:58Z")

</div>

Yes you are right, thanks
