Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ptp-dev] Git: Switching to a different branch - Help!

I thought I knew how to switch to a different branch but I guess I don't.  This should be easy/simple/intuitive but it doesn't seem that way to me.

I started writing it on the wiki at http://wiki.eclipse.org/PTP/environment_setup/git#Switching_to_a_different_branch
but I am doing something wrong.  

Here is the wiki text for reference:  PLEASE help.

SWITCHING TO A DIFFERENT BRANCH
Each repository that you clone can have one or more branches in that repository that is stored on your workstation. (e.g. master and ptp_5_0 are kept by most of our PTP developers). If you have two different workspaces for the two branches, then switching one to a branch will switch the other one too. We recommend making two different clones of the git repo, where one by default points to master, and the other points to ptp_5_0, even though they both contain both branches.

CAVEAT this does not work for me yet

Then to switch ... you want to "check out an existing branch"

▪ Select Team > Switch To... and select a branch name from the list
If there are too many branches the list does not show all of them. In this case

▪ Select Team > Switch To... > Other...
▪ On the dialog, select a branch, a tag or a Reference
▪ in my case i was already in ptp_5_0 branch; I do not see master in the same list; and i selected origin/master under "Remote Tracking" (I don't think this was right)
▪ Click Checkout button
▪ THIS DOES NOT LOOK RIGHT because now instead of repo name and branch to the right of each project node in Package Explorer, it now has "df39689..(refs/heads/ptp_5_0)" See questions below.
How do I "switch to" which i think means "checkout" another branch which in this clone of the repo? In my case my clone has master and ptp_5_0.

Question: my git repo has master and ptp_5_0 in it that i selected when i cloned the repo. I don't see where i can see what these are (branches that are in my cloned repo)

Question: what happens to changes you have made to files in your workspace (not committed or pushed) if you switch to another branch?



...Beth

Beth Tibbitts
Eclipse Parallel Tools Platform  http://eclipse.org/ptp
IBM STG - High Performance Computing Tools
Mailing Address:  IBM Corp., 745 West New Circle Road, Lexington, KY 40511


Back to the top