This summer I started to use github as a repository for my code, and I wanted to document instructions for updating a repository. This is assuming you already have created the repository, and have the appropriate .git folder on your machine, the local repository!

Get the status of your local repository


# Shows files that you have in folder, which ones are added (A) or modified (M)
git status -s

Set up your credentials


# credentials
git config --global user.name 'My Name'
git config --global user.email 'myemail.address'

Adding new files to your local repository:


git add file1 file2

Commit files to the local repository


# commits the files to your local repository -
# this will bring up a text document and you can
# uncomment the files that you want to commit, save, and exit.
git commit -a

Send to github repository


git push origin master




Suggested Citation:
Sochat, Vanessa. "GIT Basic Commands to Update Repository." @vsoch (blog), 24 Sep 2011, https://vsoch.github.io/2011/git-basic-commands-to-update-repository/ (accessed 18 Nov 24).