2

I have a wordpress project that I would to push there files in my repository.

First, when I commit, I have this message :

Untracked files:
        wordpress/

Nothing added to commit but untracked files present.

After, when I use "git push origin master", I have this :

error: src refspec master does not match any.
error: failed to push some refs to 'https://github.com/islem98/ProjetWordPress.git'

How can I fix it?

VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • You need to add files to the repository using the `git add` command. Then you need to commit those files using the `git commit` command. You may also want to use the `-u` flag if the git remote is empty. – CupOfTea696 Nov 28 '17 at 19:25
  • You may want to brush up your git knowledge with something like https://try.github.io – CupOfTea696 Nov 28 '17 at 19:26

1 Answers1

0

You might need to add first, then commit, to have a local commit to push to your remote repo.

git add wordpress
git commit -m "Add wordpress"

git push -u origin master

Note: the -u will set origin/master as the upstream branch for your local master branch, enabling you to use a simple git push for the next commits you want to put in your remote GitHub repo.
See "Why do I need to explicitly push a new branch?".

VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • See more at https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository – VonC Nov 28 '17 at 19:17