如何在有文件时克隆Bitbucket存储库?

时间:2015-12-06 13:24:30

标签: git version-control bitbucket

我有一个私有Bitbucket存储库,我将其克隆到所有客户端计算机:这是我如何将源和更新带到客户端计算机,并在开发阶段从任何客户端计算机进行更改。

最近,我遇到了从Bitbucket到客户机之一的克隆存储库的问题。这些问题与网络连接不良有关。

我必须打开Bitbucket并在另一台PC上使用Download sources as ZIP,然后使用简单的USB闪存盘将其复制到客户端计算机。

现在,我有源,但不是存储库。

如何从Bitbucket存储库中使用Git克隆并只检查我的来源,但不能再次下载?

1 个答案:

答案 0 :(得分:2)

将当前代码转换为git存储库

cd <folder>
git init

#Add the remote url of your bitbucket repository
git remote add origin <bit bucket repository url>

#Check that its working
git fetch --all --prune

#push changes to bitbucket:
git add .
git commit -m "My message..."
git push origin <master or any other branch>

另一种选择:

克隆存储库,然后添加代码

git clone <url>

# now copy all the files you need to the cloned folder

# stage your changes for commit
git add -A

# commit your changes
git commit -m "Message..."

# push changes tot he server