GitHub
Jump to navigation
Jump to search
SSH keys
- These steps only need to be done once
- If you don't have a private-public ssh key authentication setup then generate a private key and upload it to GitHub
- Run
ssh-keygen
- Display the public key by executing
cat ~/.ssh/id_rsa.pub
- Copy all of the code and paste it to your GitHub -> Settings -> SSH keys, namely https://github.com/settings/keys. Do this by hitting
New SSH key
button.
Establishing Connection
- These steps only need to be done once
- The DRMF-Seeding-Project repository can be found at https://github.com/DRMF/DRMF-Seeding-Project
- Fork the repository https://github.com/DRMF/DRMF-Seeding-Project#fork-destination-box into your personal GitHub name-space
- On the right side of the webpage, find
SSH clone URL
and copy the url underneath - In terminal use
git clone URL_YOU_COPIED
- You should now have a directory with the name
DRMF-Seeding-Project
Set up git username and email
- These steps only need to be done once
- Make sure to do this before you do your first commit otherwise you will have problems
- Run
git config --global user.name "YOUR NAME"
to set the author's name - Run
git config --global user.email "YOUR_EMAIL@example.com"
to set the author's email - Run
git config --global core.editor "vim"
to set the author's editor
Setup link to upstream
- These steps only need to be done once
- cd into folder of commitment (e.g.,
~/DRMF-Seeding-Project
) - Run
git remote add upstream git@github.com:DRMF/DRMF-Seeding-Project.git
- Run
git fetch upstream
Changing Content
- cd into folder of commitment (e.g.,
~/DRMF-Seeding-Project
) git pull upstream master
to check in modified files from the master branch- You can create any new directories for your project if necessary inside the downloaded GitHub directory
- Files you are uploading to the GitHub repository must be in the directory - copy them over from elsewhere
Committing
git status
to tell you what you changedgit add -A
to add everything which has been modified, created or deleted for the next commitgit commit
this commits all files which have been added usinggit add
git commit --amend
if you want to modify the commit messagegit push origin master
Creating Pull Request
- Go to your repo and click on
New pull request
button - Confirm by clicking on
Create pull request
button, add comment if you like, and then click onCreate pull request
button - Wait until the tests have been passed
- If there is a green button with
all checks have passed
, then ask someone to merge the pull request - Otherwise, follow the instructions to resolve the conflicts or failed tests
- If you get stuck, then write a comment there
Merging Pull Request
- First review the changes by clicking on
Files changed
- If you are happy then click on
Conversation
, scroll down, then click onMerge pull request
button