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?
- What does ‘–set-upstream’ do?
- What does ‘–set-upstream’ do?
- What is the best (and safest) way to merge a Git branch into master?
- Git merge hotfix branch into feature branch
- Git submodule update
- What does ‘git merge –abort is equivalent to git reset –merge when MERGE_HEAD is present.’ of Git merge man page mean?
- Git : fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists
- 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 to get just one file from another branch?
- How do I revert a Git repository to a previous commit?
- git checkout a single file from another branch and put in different folder
- Update Git branches from master
- How to revert multiple git commits?
- Stash only one file out of multiple files that have changed with Git?
- Create a branch in Git from another branch
- 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?
- You have not concluded your merge (MERGE_HEAD exists)
- How to get the current branch name in Git?
- Stash just a single file
- Git – Ignore node_modules folder everywhere
- 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
- Throw away local commits in Git
- Hard reset of a single file
- Hard reset of a single file
- How to remove remote origin from a Git repository
- Not a valid object name: ‘master’
- git add remote branch
- Undo a git stash
- Undo git stash pop that results in merge conflict
- How to clone all remote branches in Git
- Set up git to pull and push all branches
- Unity Collaborate vs GitHub
- SourceTree keeps asking for Github password
- Git’s local repository and remote repository — confusing concepts
- How to change the license for a project at Github?
- How to switch back to ‘master’ with git?
- Github Authentication Failed – … GitHub does not provide shell access
- How do I pull files from remote without overwriting local files?
- How can I see which Git branches are tracking which remote / upstream branch?
- How to keep a branch synchronized/updated with master?
- 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?
- How to create a local branch from an existing remote branch?
- 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”
- 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