Webstorm Git new remote repository: Push to origin/master was rejected

Simple question: In webstorm, how do I push my local directory to a remote server to make a new remote repository?

I created a local repository using webstorm as defined here: https://www.jetbrains.com/pycharm/help/setting-up-a-local-git-repository.html#createNewRepository

  • Should I delete unused branches?
  • Using git in a multi-user environment deciding, what should be implemented and what should not
  • How to verify valid format of URL as a git repo?
  • How do I sign out of the desktop version of GitHub?
  • Different databases for specific branches of git project
  • missing commits after git rebase
  • Now I have a local directory with a .git in that directory.

    I copied that .git file and put it on my remote server and renamed it as myRemote.git

    In webstorm I: git remote add origin z:\myRemote.git

    Then in webstorm I add files and push using the webstorm dialogs.

    I receive an error:
    Push rejected
    Push to origin/master was rejected.

    What does that mean? Any ideas how I can do this simple push to a remote easily?

  • Best way to merge from another git repository
  • What is a good library for JSON serialization for Scala 2.8.1 for use in Eclipse
  • After merging, but before committing, how can I force a manual re-merge on a specific file?
  • Git: moving submodules recursively (nested submodules)
  • How to get the git SHA1 value in the Implementation-Version field in the manifest for a Maven project?
  • GIT push: permission denied (public key)
  • 2 Solutions collect form web for “Webstorm Git new remote repository: Push to origin/master was rejected”

    You set up a remote repository by doing the following:

    On the remote server

    cd /some/path
    mkdir my-project.git
    cd my-project.git
    git init --bare

    Then, on the local machine (assuming there’s already a repo there)

    cd /my/project/path
    git remote add origin ssh://my-user@host.server:/some/path/my-project.git
    git push --all origin

    To change the remote that’s not working, do

    git remote remove origin
    git remote add origin ssh://...

    Also, restart Webstorm/PHPstorm to invalidate cached settings, otherwise it wouldn’t work.

    Git Baby is a git and github fan, let's start git clone.