如何将本地更改推送到bitbucket上的远程git存储库 [英] How to push local changes to a remote git repository on bitbucket

查看:135
本文介绍了如何将本地更改推送到bitbucket上的远程git存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试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

解决方案<使用 git push origin master 来代替。 您在本地有一个仓库,并且最初的 git push 是推送对它。没有必要这么做(因为它 是本地的),并且它显示所有内容都是最新的。 git push origin master 指定一个远程仓库( origin )和位于那里的分支( master )。



有关更多信息,请查看此资源


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存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆