I have a project on my local machine I've been working on alone, that I'd like to push to a remote server (running ubuntu & gitosis)
On the remote server I did
git init
Initialized empty Git repository in /home/stefan/.git/
Locally git status
says
git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .DS_Store
# .travis.yml
# license.txt
# nbproject/
# bla/.DS_Store
# bla/cache/
nothing added to commit but untracked files present (use "git add" to track)
I have also done
git remote add origin [email protected]:psdemo.git
Now: when I try to push, the following happens
git push origin master
fatal: 'psdemo.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
It makes sense in a way since I just have an empty git repo.
How can I push my files to this remote server? I guess what I need is cloning from my local machine to the remote machine, somehow?
Initialize Git in the existing project If the existing project does not already use Git, issue a git init command in the root folder. After the repository is initialized, add all of the project files to the Git index and perform a commit: git add . git commit -m "Add existing project files prior to the push to GitHub."
Go to your repository on GitHub and you'll see a button “Compare & pull request” and click it. Please provide necessary details on what you've done (You can reference issues using “#”). Now submit the pull request. Congratulations!
The string
[email protected]:psdemo.git
should be a valid ssh path. As far as I see in the previous line:
git init Initialized empty Git repository in /home/stefan/.git/
You created a repository in /home/stefan/ so I would expect something like:
[email protected]:~
But probably it isn't what you want. You should create a folder psdemo.git
in your home in the remote server. For this, do a
git init --bare ~/psdemo.git
In that and then add the remote with:
[email protected]:~/psdemo.git
Then you should be able to push!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With