0

I'm a newb, and am trying to use Git and SSH to version my files and then push it to the production server.

Here are the steps that I followed:

git init
touch readme.md
git add .
git commit -m "First commit"
ssh username@server
mkdir gittest && cd gittest && mkdir .git && cd .git
git init --bare
logout

git remote add origin ssh://username@server/gittest/.git/
git push origin master

Now, the git directories are the same, I checked manually as well as using show - but shouldn't I be seeing the readme file in the remote repo, or am I missing something? Is there another step? I'd really like to condense all my workflo

Namanyay Goel
  • 2,641
  • 3
  • 20
  • 26
  • 2
    Bare repositories don't have a checkout of anything, by design. That's why they're called bare. – Mat Feb 22 '13 at 07:52

1 Answers1

1

On the remote host you created a bare repository, i.e. it only contains the GIT data, no checkout is made. You'll need to make a non-bare clone somewhere.

Michael Wild
  • 24,977
  • 3
  • 43
  • 43
  • Thanks for the answer! Unfortunately, I don't even know how to do that.. any tips/guides/links? Thanks! And will I need to clone only once, or each time I push changes? – Namanyay Goel Feb 22 '13 at 07:55
  • You'll need to clone once and then pull every time you push. The cloning is easy: `git clone /path/to/bare.git /path/to/full`. Also, bare repositories are traditionally named `repoName.git`, so the directory name has a `.git` suffix. See e.g. [this blog article](http://danbarber.me/using-git-for-deployment/) for a possible deployment scheme. – Michael Wild Feb 22 '13 at 10:15