Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Query on Bitbucket

rahuldanwade
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 17, 2014

Version control: If I have 4 files Test1.c Test2.c Test3.c & Test4.c for two files I have to attach Version-1. For remaining two files I have to attach Ver-2.

For all the files I have to attach Ver-3.

How to check-out (pull) or check-in (push) wrt Version 1/2/3.

5 answers

1 accepted

0 votes
Answer accepted
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 18, 2014

As far as I know, Git doesn't allow you to use most of the requested commands (tag, checkout, pull, push) on individual files.

It sounds to me like you should check out the free online Git book. It should provide you the information you need, plus help you understand the basic terminology. In Git, checkout is not the same as pulling, and "checking in" (aka committing) is not the same as pushing. Also, "attach" is not a term in any versioning system I've used - I think you mean "tag".

In the book, I recommend focusing on 1.1-1.3, then chapters 2 and 3.

rahuldanwade
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 18, 2014

Hi

thanks for the suggetions

I would also like to know how Locking the required project/branch folders/files can also be donre in bitbucket.

I mean If one user checks out some code it should not be modified or updated by another user or even should not be cloned to there local repositories.


rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 18, 2014

Hi Rahul,

In Bitbucket, under (Settings > Repository Details) please make sure the following is checked:

Access Level [x] This is a private repository

As well as that, you can specify (Settings > Access Management) to an specific user or to a group

Furthermore, you can provide access through the (Settings > Deployment Keys) where you are going to add a public key in Bitbucket and provide a private key to the user you want to grant access to your repository. Please, refer to the free online Git book mentioned by Seth Foss, section 4.3 Generating Your SSH Public Key

Kind regards,
Rafael

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 18, 2014

On the other hand, if you are looking for automatic, temporary locks (only allow one person to edit any branch at a time), that is not possible.

rahuldanwade
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 19, 2014

Hi Seth,

So You mean to say If I checkout branch from master branch which has 3 files at the same time other user can check out same files to his local machin, we cant stop them by any means?

If I checkout files from central repo to my local machin does any user who has access to that central repository can access my local repo. And can I retrict other user of my team from doing checkout for same branch(files which I have in my local repository)?

As I am new to this

This foolish questions might irritate you but please give me a clarification!!!!

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 22, 2014

Not irritating at all. I'll try to provide clear answers.

There is no way to automatically restrict branches to be checked out by only one person. So, if you check out the master branch to your machine, other users can also check out the master branch to their macines.

(Git commands bolded.) Cloning a repository will NOT give other users access to your local repository. If you and another user both clone the central repo and checkout the "master" branch, then you'll each have copies of the central repository's "master" in your respective local repositories. If you both make changes and commit to your local "master" branches, then your branches will be different. To get in sync, changes need pushed to the central repository. Let's say that the other user pushes first. That will put the central repository in sync with his local one, and the central repository will be out-of-sync with YOUR local one. To remedy this, you would do a pull, which will fetch any changes to the remote repository (your friend's pushed commit) and merge those changes into your checked out branch. This will result in a new commit in your local repo (the merge). At this point you will be able to push your local changes to the central repo. Your friend can pull those changes, then all three repositories will be in sync.

If you want to reduce the frequency of pulling and merging, you can establish a policy (enforcable with self-discipline) that all major changes should be done in local-only branches (not master). These would not be available for anyone to check out except the original creator unless or until the creator pushes the branch to the central repository.

0 votes
rahuldanwade
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 18, 2014

Yes it is a git repository

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 18, 2014

Ok...and is this a Git or Hg repository?

0 votes
rahuldanwade
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 18, 2014

how to pull/push a file of version 1 or version 2 or version 3?

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 17, 2014

What do you mean "attach", and what are you trying to do?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events