SorceTree 与 Bitbucket连接

选择bitbucket,因为bitbucket免费的帐号最多可以8个人一起协同开发,我们项目组人数少于8个,私有仓库也不限制。 
经过半个多月的应用,大家感觉也还不错,对个人而言,在家也能访问代码,对公司而言还是要服务器的。下面介绍下应用,给新用者一点帮助。 
        1.注册一个bitbucket的帐号,  网址  为https://bitbucket.org/,注册之后可以在Manage Account里面将语言改成汉语; 

        2.创建仓库;

使用说明,sourcetree,bitbucket0

        3.本地创建一个空目录留着保存代码,我这里目录是C:\pfeExe\test1025,其中test1025是空文件夹;
        4.安装SourceTree(下载地址http://www.sourcetreeapp.com/),在Tools-->Options下面设置General属性和启用GIT;
        5.点击项目,点击Clone-->Clone in SourceTree,然后根据提示输入帐号信息,选择路径,至此基本配置就好了;

使用说明,sourcetree,bitbucket1

使用说明,sourcetree,bitbucket2

        6.在该目录下新建项目或者将已有项目复制到该目录下,在SourceTree中选择Add/Remove-->Commit-->Push,至此一个项目就成功的托管到bitbucket上。每次修改之前Pull一下,在本地修改之后Push,从而实现分布式协作开发;

使用说明,sourcetree,bitbucket3
        7.实际运用时遇到的一些问题: 
        7.1.克隆到本地时老是提示路径不合法,则可能是sourcetree没有启用支持GIT,就是看Tool-->Option-->Git项,是不是显示Git support is currect disabled,如果是则点击启用; 
         7.2.如果需要用代理,可以在Tool-->Option-->Network选项下面设置; 
         7.3.无法获取服务器上的更新或者看不到你的代码提交,偶尔报407错误; 
                这种情况一般是因为SourceTree处于离线状态,SourceTree里账户信息类似于session一样,有一定的时间限制,点击左下角的如下图按钮,把仓库都刷新出来,这时账户信息就更新了,处于在线状态,可以正常操作; 

使用说明,sourcetree,bitbucket4

         7.4.忽略不想要的目录,比如bin、obj目录(每次运行本机程序都会变化)
               这个在右上角的Settings的Advanced下面的Repository-specific ignore list,点击Edit输入忽略的规则;
                例如忽略所有的bin和obj目录:
                 obj/
                 bin/
        忽略规则的一些语法
        7.4.1.忽略*.o和*.a文件: *.[oa]
        7.4.2.忽略*.b和*.B文件,my.b除外:
                 *.[bB]
                  !my.b
        7.4.3.忽略dbg文件和dbg目录:dbg
        7.4.4只忽略dbg目录,不忽略dbg文件:dbg/
        7.4.5只忽略dbg文件,不忽略dbg目录:
                 dbg
                 !dbg/
        7.4.6只忽略当前目录下的dbg文件和目录,子目录的dbg不在忽略范围内:/dbg


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Bitbucket supports SSH as a secure protocol for accessing and managing your repositories. To use SSH with Bitbucket, you need to generate an SSH key pair and add the public key to your Bitbucket account. Here are the steps to set up SSH access with Bitbucket: 1. Generate an SSH key pair on your local machine if you don't have one already. You can use the `ssh-keygen` command to generate the key pair. ```bash ssh-keygen -t rsa -b 4096 -C "your_email@example.com" ``` This command will prompt you for a location to save the key pair and a passphrase (optional). Press Enter to accept the default values. 2. Once the key pair is generated, copy the public key to the clipboard using the following command: ```bash pbcopy < ~/.ssh/id_rsa.pub ``` If you're not on macOS, you can manually open the `id_rsa.pub` file and copy its contents. 3. Log in to your Bitbucket account and navigate to your avatar in the bottom left corner and click on "Bitbucket settings." 4. In the left-hand sidebar, click on "SSH keys" under the "Security" section. 5. Click on the "Add key" button. 6. Paste the copied public key into the "Key" field and provide a label for the key (e.g., "My SSH Key"). 7. Click on the "Add key" button to save the SSH key. Once you have set up SSH access, you can clone your repositories using the SSH URL. For example: ```bash git clone git@bitbucket.org:username/repository.git ``` Make sure to replace `username` with your Bitbucket username and `repository` with the name of your repository. That's it! You should now be able to use SSH to access your Bitbucket repositories.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值