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.gitchange to the
cms-dpoa-getting-starteddirectory in your local areaif
pipis not yet installed (check if it exists withwhich piporwhich pip3), installpipfollowing 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/htmldirectoryRun
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.htmlmake a new branch
yourname-updatesor a name of your choice in your local area withgit checkout -b yourname-updateseither update an existing file or make a new file with new content and add its name to
_toc.ymlbuild the book again and check changes
add the changes to git in your local area with
git add /your_new_file.md _toc.ymlin case you added a new file, or withgit add /your_updated_file.mdin 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-updatesyou’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