Skip to content

Instantly share code, notes, and snippets.

@mplsgrant
Last active December 7, 2023 03:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mplsgrant/cf8de6f0398182d633ea72dda48b2a88 to your computer and use it in GitHub Desktop.
Save mplsgrant/cf8de6f0398182d633ea72dda48b2a88 to your computer and use it in GitHub Desktop.
BitDevs Handoff

BitDevs Handoff

(or How Git Makes Collaboration Easier)

Collaboration Loop for making a change to the webiste

  1. On the GitHub website, make a personal copy of the repository by clicking the Fork button at https://github.com/BitDevsMPLS/bitdevsmpls.github.io
  2. In your terminal, use git to download your personal copy of the repo:

git clone git@github.com:YOURUSERNAME/bitdevsmpls.github.io.git

  1. cd into the bitdevsmpls.github.io folder, and use git to create a place to make your change by checking out a new branch:

git checkout -b BRANCH_NAME

Consider naming your branch something like YYYY-MM-DD-your-good-idea

  1. Use git to observe that you are now on your own branch:

git status

  1. Use your favorite editor to make a change to your personal copy of website:

vim _posts/2023-11-14-socratic-seminar-09.md

Pay attention to the date and seminar number of the file your are editing.

  1. Use git to observe that you have made changes to your copy of the website:

git status

  1. Use git to stage your change in preparation to commit.

git add _posts/2023-11-14-socratic-seminar-09.md

This is like putting your changes "on deck" to use baseball terminology.

  1. Use the status command again to observe that your changes are ready.

git status

  1. Use git to finalize your changes, and commit them to your copy of the repository.

git commit -m "Add something great to the website"

The message you provide must sound like an actual order, as if from a football coach.

  • We like "Get down and give me 20" instead of "Got down and gave 20".
  • We like "Add a new feature to the webiste" instead of "Added a new feature to the website"
  1. Use git to observe a log of your change. Press q to exit the log.

git log

  1. Use git to push your changes from your computer to your copy of the repo on GitHub.

This command may give you an error, but it will also provide your with the correct command.

git push

git push --set-upstream origin YOUR_BRANCH_NAME

  1. On the GitHub page for your repo, click the "Compare & pull request" button. On the next page, add a description for your change and click "Create pull request" button to send the changes to the admins of the website.

  2. Wait for the admins to accept your change.

  3. On GitHub, keep your personal copy of the repository updated by clicking the "Sync fork" button.

  4. In the terminal, pay attention to your current branch by using git status. Switch to the "master" branch by using this command:

git checkout master

  1. In your terminal, keep your local copy of the repository updated by running these two commands:

git fetch

git pull

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment