获取bitbucket
bitbucket.org
首先需要注册一个Bitbucket的账号
接着 需要创建一个仓库用于存放项目的
新建一个项目

项目页面
但你线上的项目创建好了之后 就可以用 sourcetree去拉取项目了
:::warning
没有sourcetree? 去下载:https://www.sourcetreeapp.com/
:::
支持 win和mac
首次打开 sourcetree
会让选择 Bitbucket的放是
这里我们选择 第一个 授权 Bitbucket的账户权限给Sourcetree
然后 通过验证后 就可以 点击 完成 了
之后就可以查看到 当前用户的项目啦
这里我们可以 创建本地项目 也可以 直接克隆项目,这里我们还是直接克隆吧.
这是演示 本地创建的:
:::info
现在我们拉取项目
现在本地创建一个项目的文件夹
:::
:::info
:::

还是点击始终允许的好 好多次呢
这是克隆后的页面
但是我们不能再这个master分支操作
我们需要自己创建一个分支
分支创建好了就是在自己的分支中操作啦
我们也可以在命令行中看一下 这几个操作 的git 样子
~ » cd Documents/demo-bitbucket~/Documents/demo-bitbucket(sugurda) » ls chery@chery-2README.md------------------------------------------------------------~/Documents/demo-bitbucket(sugurda) » git show
git show 中的内容
commit 1561b32527281dd0c718cdb62bdfd089a21a3f6b (HEAD -> sugurda, origin/master, origin/HEAD, master)
Author: chery <lemonpusi@gmail.com>
Date: Wed Apr 3 15:39:56 2019 +0000
Initial commit
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..16eff96
--- /dev/null
+++ b/README.md
@@ -0,0 +1,45 @@
+**Edit a file, create a new file, and clone from Bitbucket in under 2 minutes**
+
+When you're done, you can delete the content in this README and update the file with details for others getting started with your repository.
+
+*We recommend that you open this README in another tab as you perform the tasks below. You can [watch our video](https://youtu.be/0ocf7u76WSo) for a full demo of all the steps in this tutorial. Open the video in a new tab to avoid leaving Bitbucket.*
+
so 接着进行吧
我们新建一个文件放进去
~/Documents/demo-bitbucket(sugurda) » vim HelloWorld.py chery@chery-2
------------------------------------------------------------
~/Documents/demo-bitbucket(sugurda*) » cat HelloWorld.py chery@chery-2
print("Hello World! I am is Sugurda")
写好的文件 Sourcetree是会自己发现的

提交


选择 master 分支 可以主动合并代码
commit 99f777878b9d2d5beba095cfeaab3a3cbe86222a (HEAD -> master, sugurda)
Author: cherys <lemonpusi@gmail.com>
Date: Thu Apr 4 00:08:09 2019 +0800
update info
diff --git a/HelloWorld.py b/HelloWorld.py
new file mode 100644
index 0000000..72214f9
--- /dev/null
+++ b/HelloWorld.py
@@ -0,0 +1 @@
+print("Hello World! I am is Sugurda")
然后我们假装 这是一次正确的代码合并 然后就可以推送到 仓库了

commit 99f777878b9d2d5beba095cfeaab3a3cbe86222a (HEAD -> master, origin/master, origin/HEAD, sugurda)
Author: cherys <lemonpusi@gmail.com>
Date: Thu Apr 4 00:08:09 2019 +0800
update info
diff --git a/HelloWorld.py b/HelloWorld.py
new file mode 100644
index 0000000..72214f9
--- /dev/null
+++ b/HelloWorld.py
@@ -0,0 +1 @@
+print("Hello World! I am is Sugurda")
然后去看看我们的远程仓库吧

有了!! so 结束! 睡觉
