Git push from local computer to server but not to server

Thanks for any help.

I have a git repository on my local machine (mac osx lion) which I am trying to click on my ec2 instance using Ubuntu.

On ec2 server, I did:

cd /u/apps
mkdir stuff.git
cd stuff.git
git init --bare
git update-server-info

On my local machine, I have a β€œstuff” folder that only has a text file.

cd stuff
git init
git add .
git commit -m "initial commit"
git remote add origin user@111.111.111.111:/u/apps/stuff.git
git push origin master

Counting objects: 6, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 477 bytes, done.
Total 4 (delta 0), reused 0 (delta 0)
To user@111.111.111.111:/u/apps/stuff.git
95d5ae5..4b5a30f  master -> master

everything looks fine, but when I check the server, a new text file called "hello.txt" was not added. All I see is:

/u/apps/stuff.git$ ls
branches  config  description  HEAD  hooks  info  objects  refs

Any thoughts on what I might have forgotten?

Greetings

+5
source share
1 answer

Yes, you do not see the files because you created the bare repo ( git init --bare), as it should be. Bare repos does not have a working tree.

, , . - :

GIT_WORK_TREE=/path/where/to/checkout git checkout -f

( , .)

+6

All Articles