Maybe you just need to commit. I ran into this when I did:
mkdir repo && cd repo git remote add origin /path/to/origin.git git add .
Oops! Never committed!
git push -u origin master error: src refspec master does not match any.
All I had to do was:
git commit -m "initial commit" git push origin master
Success!
Related Posts:
- Git: Message ‘src refspec master does not match any’ when pushing commits in Git
- Git: Message ‘src refspec master does not match any’ when pushing commits in Git
- Difference between “git add -A” and “git add .”
- How do I undo the most recent local commits in Git?
- How to modify existing, unpushed commit messages?
- How do I clone a specific Git branch? [duplicate]
- Remove files from Git commit
- How do I resolve git saying “Commit your changes or stash them before you can merge”?
- How do I resolve git saying “Commit your changes or stash them before you can merge”?
- Pushing empty commits to remote
- How do I resolve git saying “Commit your changes or stash them before you can merge”?
- How to undo git reset –soft to get my changes back?
- Clone A Private Repository (Github)
- How to clone a specific Git tag
- How can I remove a commit on GitHub?
- Git how to clone with SSH key, username
- How can I add a blank directory to a Git repository?
- How do I clone a single branch in Git?
- What are the differences between “git commit” and “git push”?
- How to clone git repository with specific revision/changeset?
- Git add all files modified, deleted, and untracked?
- How do you clone a Git repository into a specific folder?
- Git – Remove commit from history
- Git clone verbose output?
- How to get Git to clone into current directory
- Add all files to a commit except a single file?
- How to get Git to clone into current directory
- Staging Deleted files
- How do I clone a subdirectory only of a Git repository?
- Differences between Commit, Commit and Push, Commit and Sync
- Git push requires username and password
- How do I check out a remote Git branch?
- How to use Git Revert
- How do I properly force a Git push?
- How to remove local (untracked) files from the current Git working tree
- Git pushing to remote branch
- How to revert a merge commit that’s already pushed to remote branch?
- Git : fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists
- How do I update Homebrew?
- Git error when trying to push — pre-receive hook declined
- How to solve SSL certificate: self signed certificate when cloning repo from github?
- Gitignore not working
- Could not open a connection to your authentication agent
- How do I revert a Git repository to a previous commit?
- How to revert multiple git commits?
- How do I fix a Git detached head?
- Why does git say “Pull is not possible because you have unmerged files”?
- How can I git stash a specific file?
- Move the most recent commit(s) to a new branch with Git
- What does “Git push non-fast-forward updates were rejected” mean?
- How do I diff the same file between two different commits on the same branch?
- How to name and retrieve a stash by name in git?
- You have not concluded your merge (MERGE_HEAD exists)
- How to get the current branch name in Git?
- Stash just a single file
- Git error on commit after merge – fatal: cannot do a partial commit during a merge
- Is there a “theirs” version of “git merge -s ours”?
- Meaning of the GitHub message: push declined due to email privacy restrictions
- Download a specific tag with Git
- Is there a command to undo git init?
- Download a single folder or directory from a GitHub repo
- Is there a “git touch” so I can push the same file with a new timestamp?
- Branch from a previous commit using Git
- How do I delete a local repository in git?
- Throw away local commits in Git
- Hard reset of a single file
- Not a valid object name: ‘master’
- git add remote branch
- How do I copy a version of a single file from one Git branch to another?
- Undo a git stash
- Undo git stash pop that results in merge conflict
- Git: cannot checkout branch – error: pathspec ‘…’ did not match any file(s) known to git
- How to clone all remote branches in Git
- Set up git to pull and push all branches
- Unity Collaborate vs GitHub
- “fatal: HttpRequestException encountered.” Error with GitHub/Bitbucket Repositories due to dropping TLS-1.0 support
- SourceTree keeps asking for Github password
- How to change the license for a project at Github?
- How to switch back to ‘master’ with git?
- fatal: could not read Username for ‘https://github.com’: No such file or directory
- Github Authentication Failed – … GitHub does not provide shell access
- How do I pull files from remote without overwriting local files?
- How to keep a branch synchronized/updated with master?
- TortoiseGit-git did not exit cleanly (exit code 1)
- How to `git pull` while ignoring local changes?
- Your repository has no remotes configured to push to
- Uninitialize git repository
- Specify an SSH key for git push for a given domain
- How do I “un-revert” a reverted Git commit?
- git push not send changes to remote git repository
- How to merge a specific commit in Git
- What is the .git folder?
- How to use Git and Dropbox together?
- Git: Where exactly is the “working directory”?
- What exactly does the “u” do? “git push -u origin master” vs “git push origin master”
- Collaboratively develop a WordPress site
- Add latest commit info on login footer using login_footer hook
- WordPress Core files not being ignored by Git
- Display GitLab repositories of the logged in user on a page
- Full site editor, hard-coded IDs in query blocks, and staging/dev servers