Working with On Line Repository

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Working with On Line Repository

SmartGit mailing list
Hello,
 I'm new to all this Version Control thing.
 

 I have an online repository at BitBucket.
I have my own local copy.
There's only 1 branch in this repository (Both local and online).
 

 When someone else updates the online repository I can see a green icon in SmartGit.
Yet I didn't understand how can I see the changes made compared to my local repository.
 

 I know I can do "Pull" yet it overwrites my local repository with the one online.
How can I see the changes before downloading them?

 

 Thank You.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Working with On Line Repository

WORMSS
You can do a "Pull > Fetch Only"

This will get all the information from the Bitbucket repository, but it will not change your working tree (files you are working on)

It will also start to put numbers in your interface near your branch name, most likely master, such as <1 or >1. I do not remember which direction off the top of my head.

These numbers mean that your local branch is 1 commit behind. < 2 for 2 behind, < 3 for 3 behind, you get the idea.

With it being a Pull > Fetch only, this will allow you to look into the log and see what that commit contains.
Make sure the little tick box next to the remote repo/remote branch is turned on. This will most likely say:
[] origin
 - [] master
Having either one of those ticked will show the commits that are ahead of your master branch.

Once you have reviewed the changes from the log you have a number of options but they all pretty much achieve the same thing in the end.

I am going to assume you have no commits you have been making but have yet to push yet.

If you do a Pull > Pull, This will merge the changes into your working tree. Attempting to keep all your changes as without causing conflicts.

If there is a conflict it will tell you, and place dark red icons on those files. Double click will bring up a dialog with 3 panels. This will show you where the conflicts are. You will need to decide if you want Their changes, your changes, or a hybrid of the two. You can type directly into the centre panel.

Remember to remove the >>>>>>>>>>>>>> and <<<<<<<<<<<<<< marks that denote where the conflicts are.

- Colin

PS:
Now if you have not pushed in a while, you may start to see 3 > < 2. This will mean that 3 commits were pushed to this branch by someone else, and you have 2 commits of your own that you have not pushed.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Working with On Line Repository

SmartGit mailing list
Hi, Thank You for your response.
 

 What happens if I made local changes and there are changes on line?
 Can I make line by line merging?
How?
 

 Thank You.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Working with On Line Repository

WORMSS
You could technically.. But then by doing that you are actually undoing someone else's work. Unless you intend to branch off and do your own thing.

If that is your intention you could do it by going into the log of the repository and selecting their latest commit as before, but then merge > to working tree.

This will merge in ALL of their code into your working tree, (and inform you of any conflicts).
You can from this point select a file, and select "", this will give you a 3 way diff dialog.
Yours / The output / Theirs ... (or maybe the other way around, Theirs / The Output / Yours)..

And then you can start undoing their work by removing their changes.. But I doubt they would like that when you commit your work.

The best thing would be to merge their commit, and use fast forward merge, and then just deal with what ever their changes cause to your work.. because atleast when you commit your stuff, it will be a continuation of both your work..
Or you start to look into doing a branch from what they are doing, and accept the fact that your work, and his work will not be able to enhance each others work, until they are both 'finished', and then merge into master.

But yeah, there is no 'great' way to only take half of their commit, if you plan to be on the same branch..

- Colin
Loading...