Git Exercise¶
Follow these instructions to add a new file or to update a file:
add a shh key for git authentication (needed to upload your changes) following the link in these instructions
in your Linux terminal, git clone this repository
git clone git@github.com:cms-dpoa/cms-dpoa-getting-started.git
change to the
cms-dpoa-getting-started
directory in your local areaif
pip
is not yet installed (check if it exists withwhich pip
orwhich pip3
), installpip
following the instructions in https://linuxize.com/post/how-to-install-pip-on-ubuntu-20.04/check the messages, you may need to add a directory to your PATH variable with
PATH="$PATH:$HOME/.local/bin"
so that the installed program can be foundrun
pip install -r requirements.txt
(orpip3
)remove files in the existing
_build/html
directoryRun
jupyter-book build .
Check your local build in your browser: if you use WSL 2 linux, you can find it in
file:///C:/Users/[USER]/[YOUR-DIRECTORY]/dpoa-getting-started/_build/html/intro.html
make a new branch
yourname-updates
or a name of your choice in your local area withgit checkout -b yourname-updates
either update an existing file or make a new file with new content and add its name to
_toc.yml
build the book again and check changes
add the changes to git in your local area with
git add /your_new_file.md _toc.yml
in case you added a new file, or withgit add /your_updated_file.md
in case you upadted an existing file, and commit themgit commit -m "Updated instructions"
push the changes of your branch to the original github repository with
git push origin yourname-updates
you’ll see a message for your updated branch in the github web interface https://github.com/cms-dpoa/cms-dpoa-getting-started, you can make a pull request to merge your branch