问题描述
我正在测试Git和Bitbucket。
我在Bitbucket上创建了一个存储库,并创建了一个本地副本,并将文件提交到它。我无法将文件从本地回购站推送到远程回购站。
以下是我正在做的事:
git clone https://me@bitbucket.org/me/test.git
cd test
touch dummy
git add dummy
git commit dummy -mmy first git commit
git push
最后一行输出:
所有最新的
当我登录到Bitbucket时,我无法看到我的虚拟文件。
我做错了什么?
编辑:
$ b
git push origin master:master
对于这个与简单的 git push ?
有关更多信息,请查看。
I'm testing out Git and Bitbucket.
I've created a repository on Bitbucket and have created a local copy of the repo and am committing files into it. I cann't seem to push the files from my local repo to the remote repo.
Here's what I'm doing:
git clone https://me@bitbucket.org/me/test.git cd test touch dummy git add dummy git commit dummy -m "my first git commit" git push
the final line outputs:
Everything up-to-date
and when I log on to Bitbucket I cann't see my dummy file.
What am I doing wrong?
EDIT:
Doing this worked:
git push origin master:master
Any explanations as to the difference between this and a simple git push?
Use git push origin master instead.
You have a repository locally and the initial git push is "pushing" to it. It's not necessary to do so (as it is local) and it shows everything as up-to-date. git push origin master specifies a a remote repository (origin) and the branch located there (master).
For more information, check out this resource.
这篇关于如何将本地更改推送到bitbucket上的远程git存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!