I have 2 remote repos: one at bitbucket, another at amazon ec2. I added the second one recently.
git remote -v
ec2 ubuntu@xx.xx.xx.xx:/home/ubuntu/my_app.git (fetch)
ec2 ubuntu@5xx.xx.xx.xx:/home/ubuntu/my_app.git (push)
origin ssh://git@bitbucket.org/me/my_app.git (fetch)
origin ssh://git@bitbucket.org/me/my_app.git (push)
When I push origin it works well. But when I push to ec2, it also seems to work well, however via ssh
don't see anything it pushed. I've done it 2 times already but I there is no source in there.
Here is a git directory at ec2:
ubuntu@ip-xx-xx-xx-xx:~/my_app.git$ ls -al
total 40
drwxrwxr-x 7 ubuntu ubuntu 4096 Mar 15 01:52 .
drwxr-xr-x 6 ubuntu ubuntu 4096 Mar 15 01:50 ..
drwxrwxr-x 2 ubuntu ubuntu 4096 Mar 15 01:52 branches
-rw-rw-r-- 1 ubuntu ubuntu 66 Mar 15 01:52 config
-rw-rw-r-- 1 ubuntu ubuntu 73 Mar 15 01:52 description
-rw-rw-r-- 1 ubuntu ubuntu 23 Mar 15 01:52 HEAD
drwxrwxr-x 2 ubuntu ubuntu 4096 Mar 15 12:04 hooks
drwxrwxr-x 2 ubuntu ubuntu 4096 Mar 15 13:30 info
drwxrwxr-x 10 ubuntu ubuntu 4096 Mar 15 13:30 objects
drwxrwxr-x 4 ubuntu ubuntu 4096 Mar 15 01:52 refs
I took this advice Can't push to repository on EC2 - Could not resolve hostname for adding ec2 as a remote git repo.
Here is one of the pushes:
$ git push ec2 master
Counting objects: 9, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 749 bytes | 0 bytes/s, done.
Total 6 (delta 3), reused 0 (delta 0)
To ubuntu@xx.xx.xx.xx:/home/ubuntu/my_app.git
123..123abc master -> master
Note: there is only one branch, gitk displays everything correctly. It just doesn't push anything to ec2.