views:

229

answers:

1

Git newbie here.

I'm building an iPhone app with PhoneGap, which has a Git repos. I'd like to keep track of my changes to the PhoneGap code (mainly, adding files to the www directory) in my own Git repository, while being able to pull the latest and greatest out of PhoneGap.

What's the best way of doing this? Is this what a branch is intended for?

Also, how would I get it to ignore the fact that I deleted folders I don't need, like the android/ and blackberry/ folder?

+4  A: 

This is exactly what a branch is for. You should work on your branch, and pull changes from the main branch, possibly using --rebase.

Can Berk Güder
How will this handle things like me renaming files? If I do a git rename on a file, will a rebase from the main branch apply updates to the renamed file, or will it create the file again with the old name?
ceejayoz
Whether you rebase or not, a rename will most likely result in a merge conflict, which you'll have to resolve manually.
Can Berk Güder
If you commit file renames without a lot of changes to thsose files in the same commit, you are unlikely to get any merge conflicts.
Paul
@Paul: even the smallest change resulted in a merge conflict in my test.
Can Berk Güder