Skip to main content
Jump to: navigation, search

Difference between revisions of "PTP/environment setup/git"

(Creating Patches)
(Questions I Have About EGit)
Line 28: Line 28:
  
 
I try to compare my local copy of branch A using Compare With>Branch, Tag, or Reference... then selecting origin/branch B from Remote Tracking. However it doesn't show all the changes even though I know they are there. Why is that?
 
I try to compare my local copy of branch A using Compare With>Branch, Tag, or Reference... then selecting origin/branch B from Remote Tracking. However it doesn't show all the changes even though I know they are there. Why is that?
 +
 +
=== Cherry Picking ===
 +
 +
If I cherry pick some changes from one branch to another, do I need to commit it? Or is it just done? How do I revert it if need to?
 +
 +
How do I only apply some of the changes from a particular commit? Cherry picking only seems to apply them all.
  
 
== Notes ==
 
== Notes ==

Revision as of 11:52, 7 November 2011

The transition is currently being planned in bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=349695

Documentation

  1. http://www.youtube.com/user/cdtdoug (CDT screencasts - last 7 videos are about GIT)
  2. http://wiki.eclipse.org/EGit/User_Guide
  3. http://wiki.eclipse.org/Git
  4. http://wiki.eclipse.org/Platform-releng/Git_Workflows
  5. http://veerasundar.com/blog/2011/06/git-tutorial-getting-started/ - nice beginning tutorial esp. describing local vs. remote repository and a nice diagram of Git Data Transport Commands

Things I Used To Be Able To Do Using CVS

Here are some things that I used to be able to do using CVS, but are either difficult or I can't work out how to do them using Git/EGit

Managing Two Branches

Say I had two branches A and B. If I added a new file (plugin, whatever) to branch A, I'd just commit it then switch over to branch B (I might have two workspaces set up, one with branch A and one with branch B). The I'd use Team>Compare With>Another Branch or Version... and add/replace any changes. Then I'd commit to branch B.

Using EGit, I need to show the history view in branch B then cherry pick the change from branch A I want (assuming it shows in the view, which sometimes it doesn't seem to). The problem with this it that you need the file to exist in the target branch before you can show it in the history view. How do you do it when a new file is added?

Creating Patches

If I had some uncommitted changes in my workspace, I could just say Team>Create Patch... to save a patch of the changes. In Git, it seems you have to commit the changes first. How do I create a patch without committing changes?

Questions I Have About EGit

Comparing

I try to compare my local copy of branch A using Compare With>Branch, Tag, or Reference... then selecting origin/branch B from Remote Tracking. However it doesn't show all the changes even though I know they are there. Why is that?

Cherry Picking

If I cherry pick some changes from one branch to another, do I need to commit it? Or is it just done? How do I revert it if need to?

How do I only apply some of the changes from a particular commit? Cherry picking only seems to apply them all.

Notes

  1. In CVS, HEAD means the 'branch' that is the latest most recent main work
    • In GIT, HEAD is the endpoint of a branch. 'master' is the 'branch' that is the latest most recent main work
      • So, there is a HEAD revision of each branch, which is the endpoint (last change).
      • E.g. there is the HEAD of master and the HEAD of ptp_5_0
  2. 'Origin' is the default name of the remote repository on eclipse.org

Back to the top