Skip to content

Conclusion

Projects Involved: OBC and GCS

Concepts: Git

Abstract:

This task covers saving your progress so far, and making a push to github. It will also cover how to write a pull request for your code.

Files Involved:

- All of them

Base Steps:

For both projects:

1. Check your git status

git status

It should tell you what branch you are on, how many files are changed/added. If you forgot to make a new branch before starting to work on onboarding:

git stash 
git checkout -b feat/<your-name>
git pop

2. Stage your changes

Staging is the process of choosing what files you want to 'commit'. In this case, we can stage all of the changes we made so far:

git add *

The next step is to 'commit' your changes. This will record the changes you chose to stage into the git history.

git commit -m "Write a commit message ex. Feat: Added...., Bug: fixed ...."

3. Push your change

Finally, we can push our changes to remote! (Github) If you followed the how2contribute documentation clearly, you should have your SSH credentials already.

git push origin feat/<your-name>

If you get an error that you don't have correct access rights, it is due to the fact that the container you are working on doesn't have access to the SSH credentials we setup earlier. Refer to the tip below to set up git credentials inside the container:

4. Opening a Pull Request

Lastly, we want to open a "Pull Request", which is code review done prior to merging your changes into a different branch. (We won't be actually merging anything, but we will use the feature to review your code as the end to your onboarding.)

Navigate to github, and go to the Pull Request tab under the each project. You should find the option to open a Pull Request based on your recent pushes. Write a short description about what the changes made in this PR entails, but focus on anything you found hard or interesting. Feel free to mention any unique features you might have added to the project.

5. The end!

Tips:

Login to GitHub within the Dev Container 1. In the terminal of your dev container, enter `gh auth login` 2. Then, answer the questions **exactly** as below with the exception of the passphrase and title of the ssh key, to which you can type in whatever you'd like, or just leave it as default:
? Where do you use GitHub? GitHub.com
? What is your preferred protocol for Git operations on this host? SSH
? Generate a new SSH key to add to your GitHub account? Yes
? How would you like to authenticate GitHub CLI? Login with a web browser
3. Complete the remaining on screen instructions 4. If successful, type in `git fetch`. You shouldn't get any errors.