How to push local changes to a remote git repository on bitbucket

前端 未结 4 1872
情歌与酒
情歌与酒 2020-12-22 15:57

I\'m testing out Git and Bitbucket.

I\'ve created a repository on Bitbucket and have created a local copy of the repo and I am committing files into it. I can\'t see

4条回答
  •  误落风尘
    2020-12-22 16:33

    This is a safety measure to avoid pushing branches that are not ready to be published. Loosely speaking, by executing "git push", only local branches that already exist on the server with the same name will be pushed, or branches that have been pushed using the localbranch:remotebranch syntax.

    To push all local branches to the remote repository, use --all:

    git push REMOTENAME --all
    git push --all
    

    or specify all branches you want to push:

    git push REMOTENAME master exp-branch-a anotherbranch bugfix
    

    In addition, it's useful to add -u to the "git push" command, as this will tell you if your local branch is ahead or behind the remote branch. This is shown when you run "git status" after a git fetch.

提交回复
热议问题