Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ptp-dev] GIT Test Repo

I have to say that branches in Git are a lot more cumbersome than CVS.

How do I commit something in my current branch to a different branch. E.g. If I have a plugin in my master branch that doesn't exist in ptp_5_0, but I want to commit it to ptp_5_0.

Greg

On Oct 28, 2011, at 4:59 PM, Roland Schulz wrote:



On Fri, Oct 28, 2011 at 4:20 PM, Greg Watson <g.watson@xxxxxxxxxxxx> wrote:
Question. If I have a clone of the ptp repo, I can import this into two different workspaces, right? But the files are note stored in my workspace, they remain in the local repo. So if I modify files in one workspace, what happens in the other workspace?
Yes. They are changed in the repo and thus will show up in both workspaces.
 
Seems like this is problematic. Does this mean I need to clone a repo for each version I need to work on (currently I have a workspace for each PTP version).

You have a two options:
1) You can clone the repository for each version. If you want to avoid the network transfer of the repo, you can clone from your other local repository (you will want to change the repo config after cloning so that it pushes/pulls directly to the main repo and not to the other local one). If you want to avoid the additional data storage on your HDD you can use the command line GIT (cGit) to do the clone (it uses hard-links and thus takes almost no space but JAVA doesn't support hard-links. The JGit/Egit can use a repository cloned by cGIT).

2) GIT makes it very fast to create branches and switch branches. Thus you might not need more than one workspace, by instead switch between the branches. The only requirement is that you don't have any uncommitted files. You can easily create that situation by creating a temporary branch for the feature you are currently working on (GIT invites you to use branches ALL the time) and committing your current status to that branch. Than you can switch to the other version or some other feature branch. It requires a fast computer though, so that compiling isn't taking too long.

Roland
 

Back to the top