Pushing files to a BitBucket repo doesn’t work

I’m new to git and would like to get started using bitbucket.org as a place to create a private repository. This can then be uploaded to the staging server using a service like ftploy.com as I understand.

I am following a tutorial on WPBeginner.com to set up a staging environment for my WordPress local website which I am developing. I set up git on the mac, ran git init on the theme folder and then added all the files using git add .

Read More

After that I made a first commit using git commit -m “message here” So far the process appeared to work. No feedback in the terminal though? I then added the line

git remote add origin https://bitbucketusername@bitbucket.org/bitbucketusername/repositoryname.git

Replacing bitbucketusername with mine and repository name with mine. Attempting to push the files to the bitbucket repository resulted in this error however:

error: --all can't be combined with refspecs
usage: git push [<options>] [<repository> [<refspec>...]]

-v, --verbose         be more verbose
-q, --quiet           be more quiet
--repo <repository>   repository
--all                 push all refs
--mirror              mirror all refs
--delete              delete refs
--tags                push tags (can't be used with --all or --mirror)
-n, --dry-run         dry run
--porcelain           machine-readable output
-f, --force           force updates
--force-with-lease[=<refname>:<expect>]
                      require old value of ref to be at this value
--recurse-submodules[=<check>]
                      control recursive pushing of submodules
--thin                use thin pack
--receive-pack <receive-pack>
                      receive pack program
--exec <receive-pack>
                      receive pack program
-u, --set-upstream    set upstream for git pull/status
--progress            force progress reporting
--prune               prune locally removed refs
--no-verify           bypass pre-push hook
--follow-tags         push missing but relevant tags

If you have any thoughts on why this may be the case I would appreciate it

Related posts

Leave a Reply

1 comment

  1. You should provide us the command you used to do your git push, but my guess is you did something like this:

    git push --all origin master
    

    As git is telling you, this can’t be used that way. Here you are asking git to push everything to origin but then you specify a branch (the <refspec>), so it is confusing.
    Either push all like this:

    git push --all origin
    

    or just your master branch like this:

    git push origin master