The entire schedule with links to each repository can be found on the GCDRI Website gcdigitalfellows.github.io
First let's review.
You can use Git to track the different versions of a file by first adding it so that Git is aware of the file you are interested in, second committing the changes you made. This all happens on your local computer. When you want these changes to be visible on the remote repo you are connected to, you then push it from the local to the remote.
The commands we covered in yesterday's session:
git config --global user.name "[name]"
git config --global user.email [email address]
git config --list
git init
git remote add origin [URL of your remote repo]
git remote -v
git status
git log
git add .
git commit -m "[clear message describing the changes you made]"
git reset
to take back staged changesgit push origin master
Remember to save your files!
Navigate from your home directory into the folder we created yesterday. From there check the status of your files.
How do we check the status of git? How do we know if Git is initialized in that folder?
Return to the mysyllabus.md you've made and add another reading or assignment so you can practice adding, committing and pushing it once more.
Once you get into the working directory (e.g. GitPractice) in the command line, you can add any files you have modified.
git add [filename]
stages a file to be tracked, and prepares it to be committed.
If you have been working on multiple files, git add --all
or git add .
adds all files if you have many to be tracked.
Remember git status
will show you what files have been staged.
Type: git commit -m "[add a message here about the commits you're making]"
Be brief but descriptive about changes in this version so that both you and your collaborators know the differences between your versions. A common way of thinking about the description is "how would future me want find this version?" Be nice to future you -- don't overcomplicate it or overthink it.
Put up a red or yellow sticky note. If you are yellow and your neighbor is red, see if you can help explain it. Teaching what you did may help you understand it better.
Because our local and remote repos are connected, we can push
our local repo to its remote directory.
In the command line, type:
git push origin master
Refresh GitHub in the browser to see your changes.
Glossary ~ ~ ~ Helpful commands