This website is hosted in this staging area: https://usc-cosmolab.github.io/cosmolab-site-v2 and is also linked from usc.cosmolab.edu. Changes made to this repository should be reflected at those links.
The following steps are required to edit and use this repository to make changes to our cosmolab website.
If contributing for the first time:
- Copy repo link from github:
- click green code block
- copy ssh link
- Clone to your computer
- In a terminal, go to the directory/folder you want the repo in
- type in terminal command:
git clone paste-ssh-link-here
Subsequently:
- Create a new branch for you to code in
git checkout -b branch_name
where branch_name is the name of the branch you wish to create- Can always call
git status
inside a git repo/directory to check up on your branch
- Make code/file/directory edits
- For images, copy and paste an image to the
cosmolab-site-v2/images
directory
- For images, copy and paste an image to the
- Preview your changes with your browser, e.g.
firefox index.html
- Add your changes
git add /path/to/edited/files
- Commit your changes
git commit -m "Provide a note of what you changed here"
- Push your changes to github
git push origin branch_name
- Last steps! Create a pull request:
- Go to our github: github.com/usc-cosmolab/cosmolab-site-v2
- A message at the top of the page should appear, saying "branch_name had recent pushes"
- Click "Compare & Pull Request"
- Make sure you are comparing branch_name to base:main
- Leave a comment and click "Create Pull Request"
- Wait on Kris/Vera to accept your PR (pull request)
There are 5 commands you need to use, listed below.
git clone link-to-repo
git checkout -b branch_name
git add /path/to/file
git commit -m "comment addressing the changes you made"
git push origin branch_name
The logic is: Clone the repo to your machine. Checkout (create) a new working branch. Edit, then Add your changed files. Commit your changes. Push the changes to github. Creat a Pull Request via web interface at the end.