This page contains a few essential Git guides. The assumption is that you have already installed Git.
I highly recommend setting up an SSH key. This will allow you to push and pull from Github without entering your password. You can follow the directions below or use the directions on GitHub.
ssh-keygen
and hit Enter.ssh-keygen
offers, including to have no password.cat ~/.ssh/id_rsa.pub
and hit enter. This will show your public key that you just created.ssh-rsa AB2dha..
You will need to use the command-line to ensure your git repos are properly configured this quarter. Here’s how you can open a command prompt to run git commands at the command prompt.
git status
. This should show you what is checked in and if you are synched (up-to-date) with origin/main or not. But be sure to run git fetch
to check that you have any changes that occured on origin/main (that, is on github.com). For example, if a teammate pushed code, you won’t see it until you run git fetch
I recommend you create new commmits and push them to main each time you finish working for a while, at least once per work day, and as many as a few times in an hour.
git status
to see your current status. See above for how to get a Git bash prompt for your project.git add .
to add everything in the current directory to Git. If you are in a subfolder, you can type cd ..
to come back up to the parent folder. Remeber ls
will show you what is in the current folder and pwd
will tell you what folder you are running commands in.git status
again. This will show the files that you are going to commit.git commmit -m "_______"
, replacing the blank with a message decribing what’s new in this commit.git status
again. This should show that you don’t have commits to make, but that you are ahead of origin/main by a few commits.git push
. This should push to main without requiring a password, if you have SSH keys set up as in the first section above.