The below steps will "clone" this Git repository to your computer. It will copy what's on Github to your computer and maintain a link between the Git repository on your computer and the Git repository on Github.
On the Code page for this repository, click the big, green Code button.
Click the copy URL button.
In your terminal, enter git clone then Cmd+v to paste the URL, then hit enter.
Enter cd CatsOneday to enter your project directory.
Hello World
The below steps will make sure you can run some code. We'll assume that you've already navigated to your project directory (step 4 in Downloading the Project).
Create a new file, Main.java. If you're using the terminal, you can do this with touch Main.java.
Alternatively, if you skip to step 2, vim will create the file when you save it.
Edit the file with vim Main.java, like you're already familiar with.
Create your main function in a Main class, just like you've done before.
In your main function, print out Hello world!.
Save! And exit.
Use javac and java to run your program like normal.
Committing and Pushing
Great! You have something working. Now, you should copy your code up to Github just in case your notebook explodes or something. Backup early; backup often.
Run git add -A to add "stage" all the files in the current directory.
What's staging? Staging tells Git that we plan to save these changed files permanently. Staging is separate from permanent saving (called "committing") because you may not want to commit every file every time.
Run git commit -m 'Prints hello world!' to permanently save your changes with a descriptive message. This is called a "commit."
You can run git log to see a history of all your commits. Hit q to exit once you're done looking through it.
Run git push to save all of the commits in your project back to Github.
Go to this project's page (link for convenience) to see your new Main.java file in the Github repository.
Great work! You've made the first, important steps on this project. Ready for some cats?
Goal
Setup your workspace for the project.
Steps
Downloading the Project
The below steps will "clone" this Git repository to your computer. It will copy what's on Github to your computer and maintain a link between the Git repository on your computer and the Git repository on Github.
git clone
then Cmd+v to paste the URL, then hit enter.cd CatsOneday
to enter your project directory.Hello World
The below steps will make sure you can run some code. We'll assume that you've already navigated to your project directory (step 4 in Downloading the Project).
Main.java
. If you're using the terminal, you can do this withtouch Main.java
.vim
will create the file when you save it.vim Main.java
, like you're already familiar with.main
function in aMain
class, just like you've done before.main
function, print outHello world!
.javac
andjava
to run your program like normal.Committing and Pushing
Great! You have something working. Now, you should copy your code up to Github just in case your notebook explodes or something. Backup early; backup often.
git add -A
to add "stage" all the files in the current directory.git commit -m 'Prints hello world!'
to permanently save your changes with a descriptive message. This is called a "commit."git log
to see a history of all your commits. Hitq
to exit once you're done looking through it.git push
to save all of the commits in your project back to Github.Main.java
file in the Github repository.Great work! You've made the first, important steps on this project. Ready for some cats?