4

I'm new to git and wanted your opinion/advice on how I should set up my repo.

I have created a new repository (public), for a project that I'm going to be working on, on github. This project is an Android app. Now suppose that I also wanted to create the same app for WebOS, would this be a different branch of the same repo? Or would I be better off creating a different repo for the WebOS app and calling it something different?

crazyscot
  • 11,819
  • 2
  • 39
  • 40
  • question about git divided by github summarizes your question pretty terribly. We know it's a question because you posted it here. We know it's about something because questions are. It's got nothing to do with github. – Dustin Jan 13 '11 at 21:57
  • I'm new here; I apologize if I wrongly categorized it. I do however feel that my question and my related follow-up questions are related to github. – mythical_man_moth Jan 14 '11 at 01:05
  • Ignore my previous response. I failed to notice that you were talking about the "Title" to my question and thought you didn't like the contents of my question ... or something. I will try and summarize my questions better in the future. – mythical_man_moth Jan 14 '11 at 01:33

1 Answers1

3

If its related to the same project I would recommend putting things in folders

  • android
  • webos
  • common
  • website

So then each folder can have the files just for the platform. You can use the common dir to use anything that is common with all of them

Amir Raminfar
  • 33,777
  • 7
  • 93
  • 123
  • thanks amir, that makes sense. i'll be working on an android and webos app and a friend will be working on the android and probably a blackberry app. So, a git pull master for me would also update the blackberry folder and for him the webos folder ... is there a way we can specify git for individual folders? – mythical_man_moth Jan 13 '11 at 21:34
  • They just added sparse checkout to git which might be what you are looking for http://stackoverflow.com/questions/180052/checkout-subdirectories-in-git. I have never used it. But with git everything is compressed so I think you don't have to worry about waiting too much. – Amir Raminfar Jan 13 '11 at 21:53
  • You rarely need to check out individual folders. The git way is to pull everything. If you think you need to check out individual folders then you might be doing something wrong. – crazyscot Jan 13 '11 at 22:32
  • crazyscot: pull everything should work for us, but I was just wondering if we could specify what we wanted to pull. thanks! – mythical_man_moth Jan 14 '11 at 00:51
  • Amir, one more thing. I have already pushed out my first commit to github ... what is a clean way to now, sort of, organize everything into neat little folders. Can I just locally organize everything and do a "git add ." and push everything to master? – mythical_man_moth Jan 14 '11 at 01:00
  • Yes I would recommend adding folders locally and pushing it. Remember if you change a file you still need to add it. On a mac i would recommend gitx. Not sure about windows. – Amir Raminfar Jan 14 '11 at 03:07
  • Thanks again Amir; I found gitx useful. – mythical_man_moth Jan 14 '11 at 19:16
  • I did organize the folders the way you mentioned but it just pushed the android folder (which has all the code) and not the other folders (which are empty), to github. I suppose once I have code for the others in place, that will show up on github too? – mythical_man_moth Jan 14 '11 at 19:19
  • Yes. Git only adds files. So if you have an empty directory it won't create the dir until it has something in it. – Amir Raminfar Jan 14 '11 at 19:22