How to use git for a group project (with eclipse) - eclipse

I am trying to figure out how to use Git in a group (php programming) project. We need to be able to commit to the same project individually. I have read different things about git and realized that there are quite a lot of ways for achieving this.
My question is: What should I download and how do I set it up the best way? And how can this be used through eclipse?
Also, should the "GIT" folder/project be located online? If so, where should this be uploaded to?
(I have read that the git plugin for eclipse isn't the best solution at all)

The best solution is to read the EGit User Guide.
No need to read the whole thing, just come back to it whenever you're stuck in using it.

Related

How do I upload small exercises to GitHub?

So basically I am trying to learn C# and JS and I'm doing so by reading documentation and solving some small exercises.
I read somewhere that uploading most of your work to GitHub is helpful when you apply for a job so people can actually see that you've been working.
Since I am not that familiar with GitHub (I read some documentation but it confused me a bit) I wanted to know what is the best way to upload my exercises there?
I think you should do some beginner course about "Git" and "Github".
It's definitely a good idea to use GitHub desktop. This tool makes it easier to manage and commit changes.
The easiest way would be to create a git repository for each of your projects. Put the files in there and upload them to GitHub.
Try looking at GitHub documentation like this to get started:
https://guides.github.com/activities/hello-world/

Alternatives to using a repository for Eclipse

I'm programming something by myself. All I want to do is be able to simply roll back to previous versions in case I find problems. What's something quick and simple to setup that works in Eclipse?
Assuming you are talking about a version control repository, if you install the git tools on your machine you can have a local repository that allows you to rollback should it be necessary. Its not really any trouble to set it up.
git init
git add whatever.c
git commit -a -m "message"
If you're looking for something simpler than this, you won't be able to find any version control packages that work without a commit cycle. If you're looking to something that will just allow you to rollback to a set moment in time you may be better off looking for an automated backup solution every X minutes... but it won't work right in eclipse.
There is a way, one is to right click and select "restore from file history"
Or File Export project, and save it on your drive.
I would strongly recommend investing an hour in learning the basics of source control, either GIT or Mercurial. I resisted this for a long time, thinking that it is "just me" and I don't need all that complexity.
Turns out using either was pretty simple. The GitHub site provides an excellent introduction. MercurialEclipse is also fairly straightforward AFTER you put in some upfront time learning about it.
There is an excellent primer on DVCS in general, and Mercurial specifically by Joel Spolsky (Co-founder of Stack Overflow, by-the-by) HERE:
hgInit by Joel Spolsky
And GitHUb is an Awesome site as well,with an excellent introduction HERE:
GitHub
It took me a while to get it all straight (the basics) as I am completely self-taught. But I have never looked back.

How do I post code to GitHub?

I've looked everywhere but I can't find any way to post code to GitHub. I tried making a repository but then it tells me I have to download a command prompt thing?
Why can't I just post code directly to it? Is there any other way?
If you are simply looking for a way to put some code online, then you can use another feature of that site calles "gists".
If you are on a mac, then there is another app you can use (made by the GitHub guys).
But the most relevant piece of software is what you refer to as " command prompt thing", which is a version control application with a relatively steep learning curve called GIT.
On a final note you might be misunderstanding what GitHub is useful for and might be better off looking at something a bit less complicated. If you are willing to explain exactly what you are looking for then i'm sure the StackOverflow community will be willing to help you :)
You may use github's gist.
Although, the main point of using github is to share git repositories.
While GitHub has recently added limited support for editing files through the web interface, it's intended as hosting for software projects using the Git source control software. The most-used interface is the command-line git tool, though there are graphical interfaces such as TortoiseGit as well as Git components for many IDEs.
If all you're looking for is a place to put small code fragments for sending to others (like a pastebin), then you probably want Gists instead: http://gist.github.com/
Github is a code hosting site for Git.
The "command prompt thingy" is likely Git. If you don't use Git, it's unlikely you want Github either.
Luckily there are graphical Git front ends such as SmartGit.

Is it possible to somehow migrate from Google Code to Github?

We have a fairly large project, and I've decided that Google Code is not quite living up to expectations. Github looks like a much more suitable platform -- but I feel like there's no escape for us. Is it a case of migrating stuff over manually? We're using svn currently, so I understand that we'll need to move to git somehow - is this going to be possible considering that I don't have admin access to our repository? Also, I know this is subjective and I don't want to start a holy war, but please also comment on your feelings about Google Code vs Github. Should we also be considering SourceForge?
I've used all, and now I am using github and I am completely satisfied. Sourceforge had annoying ads and was slow, google code didn't have the features I wanted/needed.
As for moving to github, they have a guide here, the process should be quite simple:
http://help.github.com/svn-importing/
We're using svn currently, so I understand that we'll need to move to git somehow - is this going to be possible considering that I don't have admin access to our repository?
Nope, you can use git svn to convert a repo, even if you don't have admin access. Here's a good tutorial (from one of the GitHub guys, no doubt) that explains how to convert an SVN repo to Git (including how to migrate tags and branches properly, which git-svn doesn't do very well).
but please also comment on your feelings about Google Code vs Github.
I've never used Google Code for personal projects. I know from a visitor's standpoint, I like the interface and tools used by GitHub a lot better.
Should we also be considering SourceForge?
Ugh... I personally think SourceForge is probably the worst of the free source code hosting facilities nowadays.
I think before you go through all the work to migrate to github (which is great yes) I would consider what your problem actually is. If it is just that you are using svn and that is not a distributed version control system you could just migrate your google code repository to be HG (Mercurial) based and you would get all the benefits of a distributed version control system but could otherwise stay at google code (which has great features that github does not have as well..)
Google announced today that they're closing Google Code. They added a migration tool to export projects to GitHub, it just takes one click.

How to start a major iPhone app update in Xcode

I have an app in the iPhone app store and have released several minor updates to it. I want to begin work on some major feature additions and reorganization, but don't want to lose the source code of my most recent version in case everything goes horribly wrong.
Should I start a new Xcode project from scratch and copy my existing source in? If I do this will I be able to submit the build from this new project as an update or will Apple complain that the build comes from a different Xcode project?
I've seen (but not used) Xcode's "Snapshots" and "Source Control" features - are these what I'm looking for?
Any help or direction greatly appreciated.
I would suggest getting your project into some kind of Source Control. The popular ones these days are Subversion (Xcode has built-in support for it, but the support is pretty crappy), git, and Mercurial, all of which run great on the Mac.
You would add your project to a git/svn/hg/etc repository, and then "tag" the repository with something meaningful ("Shipping Version 1.3" or something) (alternatively you could just branch your project at its current state and give that a meaningful name). Then you can do your developments, add and commit the changes to your repository. If you need to revert back to your old shipping version, that's quite simple because you tagged it before you started work (think of a tag like a snapshot).
The other option is to start a fresh Xcode project and copy things over. I have personally done this and shipped just fine to the App Store (just make sure things like your app's bundle id "com.whatever.app" matches with the original one, and make sure you codesign properly) and you're good to go.
Having said that, unless you have a really great reason to start with a fresh project, you're probably better off using source control management with one of the aforementioned tools (git is my preference).
You are using some form of source control right? If not, stop what you are doing and make sure to set up an svn repository. Svn is bundled with your mac and integrates with Xcode.
You also may want to start thinking about doing backups...
I highly recommend you check out Git. There is great Git support built into XCode 4, and you can use Git just fine with XCode 3 as well.
One great thing about Git is that you do not need a server to take advantage of the source code management features. It is a lot easier for a solo developer to work with than SVN once you get your head wrapped around it.
I also highly recommend GitX - a free graphical UI for Git that is absolutely amazing.
One other recommendation it GitBox - a simple tool that allows using a Dropbox as a Git master repository. This is great for sharing code between multiple machines without needing to have or pay for Git hosting at GitHub or elsewhere.
You can either do what the people said before, and use svn git or the like, OR if you don't want to mess around with any of that you can simply create your own version control by copying and pasting the folder and name it "project name x.x" and modify the version without the version number on it
snapshots are the first step. when you are comfortable with them you can hook up to an SVN server for your offsite backup
just make a snapshot after your distribution build and label with the version number
The quickest, easiest, short-term solution is to select the Xcode project folder, and duplicate it. This will create a duplicate of everything in the project. Apple won't care that it comes from a duplicate project.
For the long term, look into setting up an SVN. This will help you save your previous versions every time you make changes.
Since you are new to source control management so might I suggest using Subversion.
Subversion has less features than Git, but you don't have the confusion between pushing and committing (locally vs remotely) and you will find there is more software that supports Subversion than Git or Mercurial.
If you need a quick backup, you can always zip the current working folder for your Xcode project, then name it something like:
MyApplication-Version-1.00.zip