How do I do an initial push to a remote repository with Git?
I’ve read through countless tutorials and I keep coming up short. Here’s what I’ve got:
- I’m running RubyMine on my Windows desktop
- I’ve installed Git on my WebFaction hosting account per their instructions
- Git appears to be working fine on both machines
Here’s what I’m doing:
- On server:
git add .
git commit #==> nothing to commit
- On client:
- Create new project in RubyMine
- Git init in top directory of project
- Push changes to server
#==> failed to push some refs to...
What steps am I missing?
mkdir my_project.git cd my_project.git git --bare init
mkdir my_project cd my_project touch .gitignore git init git add . git commit -m "Initial commit" git remote add origin firstname.lastname@example.org:/path/to/my_project.git git push origin master
Note that when you add the origin, there are several formats and schemas you could use. I recommend you see what your hosting service provides.
Answered By – Josh Lindsey