For the arcade game project, you will be doing group development. Therefore, we'll be asking you to use a source control system called git. You've already used git to checkout code/homework from the CSSE220 repo, but for this project you will be managing a repo.
- Go to: https://github.com/join
- Create an account with the following username: rhit-student
- Be sure to replace "student" with your Rose-Hulman username.
- Check your email for a link to accept a github assignment from your professor
- It will look something like this: https://classroom.github.com/g/xyzabc
- Click "Authorize github"
- Join the team number defined by your instructor (or create one with the correct name, i.e. team11 )
This step should be done by everyone in your team.
- In your browser, at the top of this page, you should find a green button you can use to copy the URI of this project to your clipboard.
- Open your Eclipse and go to File > Import > Git > Projects from Git
- Select "Clone URI"
- It should automatically get filled out for you, but if not, in the URI field paste the URL you took from the website. Host and repository path should get filled out for you.
- In Authentication, enter your GITHUB username and password (you might find it convenient to have it save these for you) and hit Next
- In branch selection make sure master is checked and click next
- In local destination, you can configure anywhere you like except the directories that your existing CSSE220 repos are being checked out to
- Select "Import existing eclipse projects" and select next.
- You should see "ArcadeGameGit-00" on the list, make sure it's checked and select next
- You should see a folder for ArcadeGameGit-00 in your project browser
Have one member of your team make a change and push it. Here's how:
- In eclipse, rename your project to have your team number instead of 00. Right Click on ArcadeGameGit-00 then Refactor->Rename:
- Right click on the project folder and select Team > Commit
- Verify that .project appears in your list of "Staged Changes"
- Also add the .gitignore to your staged changes (if not already) by selecting it and clicking +
- Add some text in the commit message
- Select Commit and push
Have everyone else on your team pull the latest version
- Right click on the project folder and select Team > Pull
- You might have to enter your GITHUB username and password
- You should get the updated files
Have everyone in your team
- Edit the same line of code in a different way. Say add your name to the println.
- Attempt to commit and push.
- The first person who does it should succeed. The rest should get a "rejected non-fast-forward" error.
For one of those those who failed:
- Right click on the project folder and select team > Pull
- You should see a message about conflict and things will look sort of scary
- Look at the edited file. You should see that both versions of the code are there plus some <<<<< ===== >>>> lines
- Figure out what the combination of the changes ought to be (probably all your names in the println) and edit the file to be correct, deleting all unnecessary stuff
- Test your code and make sure that everything works as expected
- Right click on the project folder and select Team > Commit
- Manually move all your files into "Staged changes" with the +
- Commit and push
- Now have the original committer pull and they should have the merged version too
- If they are any other members of year team, have them do step 4 onward
You have the basics!
- Do this only if you already have some version of coding running.
- Have the team member who has the latest version of your source code copy all the files into ArcadeGameGit-** (hint: you can select files in the eclipse package explored and use right click copy and paste)
- Test and verify that the game runs in its new project
- Stage all the files, and then commit and push them
- Have everyone else pull the changes
- Verify that everyone has a running up to date game on their eclipse
Done!
- Pair program whenever possible
- Always do a Team Pull before you begin programming
- Always to a Team Commit/Push when you finish
- In Eclipse: Right Click -> Replace With -> HEAD Revision is a nice way to remove your local changes before doing a Team->Pull if you don't care about the local version of your code and just want to get your partner's version
- If you do have to resolve a merge conflict, remember you must accommodate both changes
- A more advanced and full feature program can be used to use Git for Windows
- MacOS and Linux have terminal/consoles that can interact with git natively
- There might be times when using these toola will be easier than Eclipse alone
- You are welcome to install it, but in most cases it should not be required
- More about git: git-handbook