GIT: Better method of setting up fresh repo

With creating a fresh git repo, I am wanting to know what is best practice. Ether creating the git repo locally and pushed, or remotely and pulled.
.

Method 1

  • fatal: cannot create directory at /root/wp-content/cache/page_enhanced/… No such a file or directory
  • Speeding up Jenkins build
  • Does git merge reapply commits onto another commit?
  • GitHub push error - 'git media update'
  • How can one make git first parent consistent without rebasing?
  • How can I checkout out the HEAD version of my remote/tracking branch
  • Local machine (inside whatever project folder)

    git init
    git add .
    git commit -m 'initial commit'
    git remote add origin <server-repo-url>
    git push --all origin
    

    Or is it better practice to set up the repo on the server and then pull from it onto your local machine?

    Method 2

    Remote server

    mkdir myrepo.git
    cd myrepo.git
    git --bare init
    

    Or does it even matter?

  • Git won't revert or commit a file that it thinks is modified
  • Force Feature Branch to be Rebased Before it is Merged or Pushed
  • Library (jar) dependencies between github repositories
  • heroku: Gemfile.lock is required issue
  • Auth fails on Windows XP with git and tortoisegit
  • How to make git ignore certain file conflicts and differences?
  • 2 Solutions collect form web for “GIT: Better method of setting up fresh repo”

    It doesn’t particularly matter. Git is designed to allow the equivalent repositories to be shared between clients and servers. So long as your client(s) are fully configured to work with a repository on the server, they’re both great.

    Doesn’t matter. Either repo can be discarded once both are up and running.

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