linux sourcetree,Sourcetree

After looking through the Intergalactic Mall Magazine, you see a pair of speakers that you really want for the space station. They are big enough to produce a good amount of sound and soft enough that the lack of gravity won't cause them to crash. The only problem is that they pretty pricey, and you need approval before you can officially add them to your list of supplies.

In the meantime, create a feature branch so that you can update the supply to your request list while you wait. Then when you have approval, you just merge the requests file from the feature branch into the main branch.

Branches are most powerful when you're working on a team. You can work on your own part of a project from your own branch, pull updates from Bitbucket, and then merge all your work into the main branch when it's ready. Our documentation includes more explanation of why you would want to use branches.

Step 1: Create a branch and make a change

Let's create a branch so that you can list the speakers in your supply requests file. Even though branches work differently between Git and Mercurial, you create them in a similar way from Sourcetree. From Sourcetree, click the Branch button.

c8ba7fff1aeb512051727e77624270d4.png

Depending on whether you have a Git or Mercurial repository, you see a different popup for creating a new branch. From the New Branch or Create a new branch field, enter wish-list for the name of your branch.

1905471483965d75c12b7101416d2c36.png

fe15b9da9f06fc32376b05addd9fd8a2.png

Click Create Branch or OK.

From Sourcetree, click the Show in Finder button. The directory on your system opens.

7dd8432c90c36406f1f5db9480fac9c0.png

From the directory folder, open the supplyrequest file with a text editor.

Making a change to the file by adding the following item to the list of supplies:

anti-gravity speakers

Save the file.

Open the view in Sourcetree and notice that your repository now has uncommitted changes.

9d791b67cde7b5b85a07640b90d12191.png

From here, everything you do is the same as you did when you added the supplyrequest file and initially committed it.

If you have a Git repository, make supplyrequest.txt ready to commit by selecting Stage file from the options menu.

43874cafa824b22ecd4254ac3ac95ecc.png

Click the Commit button at the top to commit the file.

In the message box, enter "Adding an item for my wish list."

Click the Commit button under the box. From Sourcetree, you see that the file has been updated on the wish-list branch.

8858e79cdca989d6406c8ee49a97e200.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值