Difference between revisions of "GitHub"

From Coder Merlin
m (Editorial review and minor corrections)
 
(14 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== Curriculum ==
{{MerlinCurriculumData|{{ROOTPAGENAME}}}}
[[File:GitHub Zombie Octocat.png|thumb|GitHub Zombie Octocat]]
[[File:GitHub Zombie Octocat.png|thumb|GitHub Zombie Octocat]]
== Prerequisites ==
* [[W1002 The Client, the Server, and the Shell]]
* [[W1004 Emacs]]
* [[W1005 Digital Journal]]
* [[W1006 Source Control]]


== Introduction ==
== Introduction ==
While using git locally is a wonderful way to track our revisions and enable us to rollback to previous versions, in order to take full advantage of git we'll use '''GitHub'''. GitHub is a service where we can replicate (copy) our repository and collaborate with others.
Although using git locally is a wonderful way to track our revisions and enables us to rollback to previous versions, to take full advantage of git we'll use '''GitHub'''. GitHub is a service where we can replicate (copy) our repository and collaborate with others.


== A GitHub Account ==
== A GitHub Account ==
Your guide will set up a repository for your use for this assignment. Be sure to follow the instructions carefully. In order to participate, you'll need a GitHub account. GitHub accounts are free to create.
Your guide will set up a repository for your use for this assignment. Be sure to follow the instructions carefully. To participate, you'll need a GitHub account. GitHub accounts are free to create.


# Go to https://github.com
# Go to https://github.com
# Click on the [[File:GitHub-Sign_up_Button.png|link=]] button at the top, right-hand side of the page
# At the top, right-hand side of the page, click the [[File:GitHub-Sign_up_Button.png|link=]] button.
# On the next page ("Set up your account") there will be a short form:
# On the next page, called Set up your account, fill in this short form:
## Create a unique (and appropriate) username
## Create a unique (and appropriate) username.
## Provide an accessible email address, as directed by your guide
## Provide an accessible email address, as directed by your guide.
## Provide a password
## Provide a password.
## You may receive a small puzzle to solve; if so, solve the puzzle
## You might receive a small puzzle to solve; if so, solve the puzzle.
## Click on the "Create Account" button [[File:GitHub-Create_Account_Button.png|link=]]
## Click the '''Create Account''' button. [[File:GitHub-Create_Account_Button.png|link=]]
# On the next page you may have a brief survey. At the bottom, click the "Complete Setup" button [[File:GitHub-Complete_Setup.png|link=]]
# On the next page, you might have to fill in a brief survey. At the bottom, click the '''Complete Setup''' button. [[File:GitHub-Complete_Setup.png|link=]]
# You'll receive an email to the address you specified.
# You'll receive an email to the address you specified.
## Check your email client and find the email from GitHub
## Check your email client and find the email from GitHub.
## Click the [[File:GitHub-Confirm_Email_Button.png|link=]] button
## Click the [[File:GitHub-Confirm_Email_Button.png|link=]] button.


== Configuration ==
== Configuration ==
In order to use these commands with a remote repository, it's best to cache your credentials. On the command line, execute:
To squelch the warning that occurs while pushing, execute the following:
{{ConsoleLine|jane-williams@codermerlin:~$|git config --global credential.helper 'store --file ~/.git-credentials'}}
{{ConsoleLine|jane-williams@codermerlin:~$|git config --global push.default matching}}
{{ConsoleLine|jane-williams@codermerlin:~$|git config --global credential.useHttpPath true}}
 
Note: This command, if successful, completes '''silently'''.
 
== Token Allocation ==
Tokens are a safer alternative to passwords. They have these characteristics:
# '''Unique''' to a service and therefore can't be reused on another
# '''Revocable''' individually without adversely affecting other credentials
# '''Limited''' to authorization for a specific use case without the need for broader access
# '''Random''' and thus not subject to dictionary attacks


In order to squelch the warning that occurs while pushing, execute:
To allocate your token for {{CM}} on GitHub, carefully follow these instructions:
{{ConsoleLine|jane-williams@codermerlin:~$|git config --global push.default matching}}
=== Generate a New SSH Key ===
{{ConsoleLine|jane-williams@codermerlin:~$| ssh-keygen -t ed25519 -C "jane-williams@codermerlin.com"}}
Be sure to replace the above email address with your actual email address used for GitHub.


Note: These commands, if successful, will complete '''silently'''.
You'll then be presented with a series of prompts. Unless otherwise instructed by your guide, press {{Key|Return}} for each to accept the default.
{{ConsoleLines|
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/jane-williams/.ssh/id_ed25519): {{Key|Return}}
Enter passphrase (empty for no passphrase): {{Key|Return}}
Enter same passphrase again: {{Key|Return}}
Your identification has been saved in /home/jane-williams/.ssh/id_ed25519
Your public key has been saved in /home/jane-williams/.ssh/id_ed25519.pub
The key fingerprint is:
SHA256:t0kJmRZa4ImzPbO88e2Onkbuwbews73rzjSB5zifU9o john-williams@codermerlin.com
The key's randomart image is:
+--[ED25519 256]--+
+----[SHA256]-----+
}}
=== Add the Key to GitHub ===
{{ConsoleLine|jane-williams@codermerlin:~$| cat ~/.ssh/id_ed25519.pub}}
Copy the contents of the file to your clipboard. Then do the following:
# Go to GitHub.com
# In the upper-right corner of any page, click your profile photo, then click '''Settings'''.
# In the "Access" section of the sidebar, click '''SSH and GPG keys'''.
# Click '''New SSH key''' or '''Add SSH key'''.
# In the Title field, add a descriptive label for the new key.
# Paste your key into the Key field.
# Click '''Add SSH key'''.
 
=== Test your Key ===
{{ConsoleLine|jane-williams@codermerlin:~$| ssh -T git@github.com}}
If successful, you should see something like below:
{{ConsoleLines|
> Hi username! You've successfully authenticated, but GitHub does not
> provide shell access.
}}


== Assignments ==
== Assignments ==
Your guide will create a GitHub assignment for you. You'll receive an email with an invitation link.
Your guide will create a GitHub assignment for you. You'll receive an email with an invitation link.
# Sign in to GitHub using the correct account BEFORE clicking on the link
# BEFORE clicking the link, sign in to GitHub using the correct account.
# Click on the link
# Click the link.




{{Hint|
{{Hint|
Your guide will create assignments for you which are "Private"; they'll only be visible to you (or your group for group assignments) and your guide. If you create any repositories on your own, be sure you select the correct setting.
Your guide will create assignments for you that are '''Private'''; that is, they'll be visible only to you (or your group for group assignments) and your guide. If you create any repositories on your own, be sure you select the correct setting.
}}
}}


== Joining the Classroom Roster ==
== Joining the Classroom Roster ==
The first time that you click on an assignment you'll be asked to join the classroom roster. You'll see a message similar to: "Join the classroom roster: Your teacher has configured this classroom to pair GitHub accounts with identifiers."
The first time you click an assignment, you'll be asked to join the classroom roster. You'll see a message like, "Join the classroom roster: Your teacher has configured this classroom to pair GitHub accounts with identifiers."
# Click on your identifier. (Do NOT skip this step.)
# Click your identifier. (Do NOT skip this step.)
# The next page will present you with an [[File:GitHub-Acccept_This_Assignment_Button.png|link=]]. Click the button.
# The next page presents you with an [[File:GitHub-Acccept_This_Assignment_Button.png|link=]]. Click the '''Accept this assignment''' button.
# You'll may see a progress bar (or two). Be patient as your assignment is prepared. When the assignment is ready, you'll see the message: "You are ready to go!"
# You might see a progress bar (or two). Be patient as your assignment is prepared. When the assignment is ready, you'll see the message: "You are ready to go!"
# They'll be a link at the very bottom of the page, immediately after the text "Your assignment has been created here:" Click on that link. '''You'll need this link in a subsequent step in this experience.'''
# A link should be ready at the very bottom of the page, immediately after the text "Your assignment has been created here:" Click that link. '''You'll need this link in a subsequent step in this experience.'''
 


{{Hint|
{{Hint|
The link that you just clicked on is the link to your personal repository for the assignment. It might be something that you'd like to bookmark.}}
The link that you just clicked is the link to your personal repository for the assignment. It might be something that you'd like to bookmark.}}


== First GitHub Assignment ==
== First GitHub Assignment ==
Your first GitHub assignment will be to sync all of your journals with GitHub. In order to do so, you'll need to specify a GitHub URL as your "remote" for your existing git repository.
Your first GitHub assignment will be to sync all of your journals with GitHub. To do so, you'll need to specify a GitHub URL as your "remote" for your existing git repository.


Enter your Journals directory:
Enter your Journals directory:
{{ConsoleLine|john-williams@codermerlin:~$|cd ~/Journals}}
{{ConsoleLine|john-williams@codermerlin:~$|cd ~/Journals}}


Remember that you've already added all of these files to your local git repository. You can easily verify this by checking the status.
Remember that you've already added all these files to your local git repository. You can easily verify this by checking the status.
{{ConsoleLine|john-williams@codermerlin:~/Journals$|git status}}
{{ConsoleLine|john-williams@codermerlin:~/Digital Portfolio/CS-I/Journals$|git status}}


You should see something similar to:
You should see something like below:
{{ConsoleLines|
{{ConsoleLines|
On branch master<br/>
On branch master<br/>
Line 71: Line 109:
}}
}}


Let's add the remote. To do so, we'll need the URL from the above assignment. It will be something similar to:<br/><nowiki>https://github.com/.../2024-journals-JohnWilliams</nowiki><br/>
Let's add the remote. To do so, we'll need the URL from the above assignment. It will be something similar to:<br/><nowiki>https://github.com/.../2024-journals-JohnWilliams</nowiki><br/>
Be sure to use '''your own''' url, which will be unique to you.
Be sure to use '''your own''' url, which is unique to you.
{{ConsoleLine|john-williams@codermerlin:~/Journals$|git remote add origin <nowiki>https://github.com/.../2020-journals-JohnWilliams.git</nowiki>}}
{{ConsoleLine|john-williams@codermerlin:~/Journals$|git remote add origin <nowiki>https://github.com/.../2020-journals-JohnWilliams.git</nowiki>}}


Line 78: Line 116:
{{ConsoleLine|john-williams@codermerlin:~/Journals$|git push -u origin master}}
{{ConsoleLine|john-williams@codermerlin:~/Journals$|git push -u origin master}}


You'll then be promoted to enter your username and password. Remember to use '''your GitHub''' username and password. After the push is completed, go back to the browser and refresh the page.
You'll then be promoted to enter your username and password. Remember to use '''your GitHub''' username and '''token'''. After the push is completed, go back to the browser and refresh the page.


== Workflow Overview ==
== Workflow Overview ==
Line 91: Line 129:
# <code>push</code> the local repository to the remote
# <code>push</code> the local repository to the remote


The most significant difference is that we'll need to keep in mind that others may also be working on the remote repository, so we'll need to sync their remote changes with our local repository. The best practice is to perform a <code>pull</code> ''prior'' to beginning work in the working directory.
The most significant difference is that we'll need to keep in mind that others might also be working on the remote repository, so we'll need to sync their remote changes with our local repository. The best practice is to perform a <code>pull</code> ''before'' beginning work in the working directory.


== Tagging ==
== Tagging ==
As you progress through your work, whether it be code or prose, you'll accumulate more and more commits each with their own version of a particular file. There'll be times when you'll need to mark a specific commit. For example, you may want that commit to be reviewed by your editor or by quality assurance personnel. Git is able to mark specific points in the repository as being important. This process is called '''tagging''' and the mark itself is called a '''tag'''. It's important to note that the ''entire'' repository at a given point in time is tagged, not a particular file or group of files.
As you progress through your work, whether it be code or prose, you'll accumulate more and more commits, each with its own version of a file. There will be times when you'll need to mark a specific commit. For example, you might want that commit to be reviewed by your editor or by quality assurance personnel. Git is able to mark specific points in the repository as being important. This process is called '''tagging''', and the mark itself is called a '''tag'''. It's important to note that the ''entire'' repository at a given point in time is tagged, not one file or group of files.
 
=== Tagging Locally ===
=== Tagging Locally ===
A tag can be placed on the repository with the following command, replacing ''tagName'' with the actual name of the tag.
A tag can be placed on the repository with the following command, replacing ''tagName'' with the actual name of the tag.
Line 100: Line 139:
For example:
For example:
{{ConsoleLine|john-williams@codermerlin:~$ |git tag E1399.Outline}}
{{ConsoleLine|john-williams@codermerlin:~$ |git tag E1399.Outline}}
=== Pushing a Specific Tag to a Remote ===
=== Pushing a Specific Tag to a Remote ===
A tag may be pushed to a remote repository with the following command:
To push a tag to a remote repository, use the following command:
{{ConsoleLine|john-williams@codermerlin:~$ |git push origin {{Yellow|tagName}}}}
{{ConsoleLine|john-williams@codermerlin:~$ |git push origin {{Yellow|tagName}}}}


Line 109: Line 149:


{{Caution|
{{Caution|
Pushing a tag will include all required objects for that tag, but will ''NOT'' include any other references. For example, it will not include your commits.  Therefore, it is vital that you first push your commits by executing:
Pushing a tag includes all required objects for that tag, but does ''NOT'' include any other references. For example, it does not include your commits.  Therefore, it is vital that you first push your commits by executing the following:


{{ConsoleLine|john-williams@codermerlin:~$ |git push}}
{{ConsoleLine|john-williams@codermerlin:~$ |git push}}
Line 117: Line 157:


=== Deleting a Tag Locally ===
=== Deleting a Tag Locally ===
A tag may be deleted locally with the following command, replacing ''tagName'' with the actual name of the tag.
You can delete a tag locally by using the following command, replacing ''tagName'' with the actual name of the tag.
{{ConsoleLine|john-williams@codermerlin:~$ |git tag --delete {{Yellow|tagName}}}}
{{ConsoleLine|john-williams@codermerlin:~$ |git tag --delete {{Yellow|tagName}}}}
=== Deleting a Tag from a Remote ===
=== Deleting a Tag from a Remote ===
A tag may be deleted from a remote with the following command, replacing ''tagName'' with the actual name of the tag.
You can delete a tag from a remote with the following command, replacing ''tagName'' with the actual name of the tag.
{{ConsoleLine|john-williams@codermerlin:~$ |git push --delete origin {{Yellow|tagName}}}}
{{ConsoleLine|john-williams@codermerlin:~$ |git push --delete origin {{Yellow|tagName}}}}


== Best Practices ==
== Best Practices ==
{{ComingSoon|
{{ComingSoon|
* Include only essential files required to reproduce project (e.g. source files)
* Include only essential files required to reproduce project (e.g., source files)
* Avoid unnecessary files (e.g. compiled products and temporary files)
* Avoid unnecessary files (e.g., compiled products and temporary files)
* How to use .gitignore
* How to use .gitignore
}}
}}
Line 132: Line 172:
== Key Concepts ==
== Key Concepts ==
{{KeyConcepts|
{{KeyConcepts|
* '''GitHub''' is a service where we can replicate (copy) our repository and collaborate with others
* '''GitHub''' is a service where we can replicate (copy) our repository and collaborate with others.
* GitHub serves as a '''remote repository'''
* GitHub serves as a '''remote repository'''.
* The '''workflow''' when using a remote repository is very similar to that using only a local repository except that additional commands are required
* The '''workflow''' when using a remote repository is very similar to that using only a local repository except that additional commands are required.
** '''push''' will push the files ''from'' the ''local'' repository ''to'' the ''remote'' repository
** '''push''' pushes the files ''from'' the ''local'' repository ''to'' the ''remote'' repository.
** '''pull''' will pull the files ''from'' the ''remote'' repository ''to'' the ''local'' repository (and working directory)
** '''pull''' pulls the files ''from'' the ''remote'' repository ''to'' the ''local'' repository (and working directory).
** '''tag''' will mark a specific commit as 'special'
** '''tag''' marks a specific commit as 'special'.
** '''push origin <tag>''' will push the specified tag ''from'' the ''local'' repository ''to'' the ''remote'' repository
** '''push origin <tag>''' pushes the specified tag ''from'' the ''local'' repository ''to'' the ''remote'' repository.
}}
}}


Line 147: Line 187:
* [https://en.wikipedia.org/wiki/Git Git (Wikipedia)]
* [https://en.wikipedia.org/wiki/Git Git (Wikipedia)]
* [https://git-scm.com/book/en/v2/Git-Basics-Tagging Tagging] (Git Documentation)
* [https://git-scm.com/book/en/v2/Git-Basics-Tagging Tagging] (Git Documentation)
{{Experience
|experienceID=W1007.10
|experienceUnit=Lab basics
|knowledgeAndSkills=§10.231;§10.232
|topicAreas=Source control systems
|classroomTime=60 minutes
|studyTime=3 hours
|acquiredKnowledge=understand the purpose of a source control system when working with multiple users
|acquiredSkill=ability to push and pull changes to/from the source control system;
ability to use a source control system to merge changes;
ability to properly handle merge conflicts;
}}

Latest revision as of 16:32, 29 September 2023

Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder

Curriculum[edit]

ExercisesIcon.png
 Coder Merlin™  Computer Science Curriculum Data

Unit: Lab basics

Experience Name: GitHub (W1007.10)

Next Experience: ()

Knowledge and skills:

  • §10.231 Demonstrate proficiency in using a source control system for single-users
  • §10.232 Demonstrate proficiency in using a source control system with multiple users

Topic areas: Source control systems

Classroom time (average): 60 minutes

Study time (average): 180 minutes

Successful completion requires knowledge: understand the purpose of a source control system when working with multiple users

Successful completion requires skills: ability to push and pull changes to/from the source control system; ability to use a source control system to merge changes; ability to properly handle merge conflicts

GitHub Zombie Octocat

Introduction[edit]

Although using git locally is a wonderful way to track our revisions and enables us to rollback to previous versions, to take full advantage of git we'll use GitHub. GitHub is a service where we can replicate (copy) our repository and collaborate with others.

A GitHub Account[edit]

Your guide will set up a repository for your use for this assignment. Be sure to follow the instructions carefully. To participate, you'll need a GitHub account. GitHub accounts are free to create.

  1. Go to https://github.com
  2. At the top, right-hand side of the page, click the GitHub-Sign up Button.png button.
  3. On the next page, called Set up your account, fill in this short form:
    1. Create a unique (and appropriate) username.
    2. Provide an accessible email address, as directed by your guide.
    3. Provide a password.
    4. You might receive a small puzzle to solve; if so, solve the puzzle.
    5. Click the Create Account button. GitHub-Create Account Button.png
  4. On the next page, you might have to fill in a brief survey. At the bottom, click the Complete Setup button. GitHub-Complete Setup.png
  5. You'll receive an email to the address you specified.
    1. Check your email client and find the email from GitHub.
    2. Click the GitHub-Confirm Email Button.png button.

Configuration[edit]

To squelch the warning that occurs while pushing, execute the following:

jane-williams@codermerlin:~$ git config --global push.default matching

Note: This command, if successful, completes silently.

Token Allocation[edit]

Tokens are a safer alternative to passwords. They have these characteristics:

  1. Unique to a service and therefore can't be reused on another
  2. Revocable individually without adversely affecting other credentials
  3. Limited to authorization for a specific use case without the need for broader access
  4. Random and thus not subject to dictionary attacks

To allocate your token for  Coder Merlin™  on GitHub, carefully follow these instructions:

Generate a New SSH Key[edit]

jane-williams@codermerlin:~$  ssh-keygen -t ed25519 -C "jane-williams@codermerlin.com"

Be sure to replace the above email address with your actual email address used for GitHub.

You'll then be presented with a series of prompts. Unless otherwise instructed by your guide, press Return for each to accept the default.

Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/jane-williams/.ssh/id_ed25519): Return
Enter passphrase (empty for no passphrase): Return
Enter same passphrase again: Return
Your identification has been saved in /home/jane-williams/.ssh/id_ed25519
Your public key has been saved in /home/jane-williams/.ssh/id_ed25519.pub
The key fingerprint is:
SHA256:t0kJmRZa4ImzPbO88e2Onkbuwbews73rzjSB5zifU9o john-williams@codermerlin.com
The key's randomart image is:
+--[ED25519 256]--+
+----[SHA256]-----+

Add the Key to GitHub[edit]

jane-williams@codermerlin:~$  cat ~/.ssh/id_ed25519.pub

Copy the contents of the file to your clipboard. Then do the following:

  1. Go to GitHub.com
  2. In the upper-right corner of any page, click your profile photo, then click Settings.
  3. In the "Access" section of the sidebar, click SSH and GPG keys.
  4. Click New SSH key or Add SSH key.
  5. In the Title field, add a descriptive label for the new key.
  6. Paste your key into the Key field.
  7. Click Add SSH key.

Test your Key[edit]

jane-williams@codermerlin:~$  ssh -T git@github.com

If successful, you should see something like below:

> Hi username! You've successfully authenticated, but GitHub does not
> provide shell access.

Assignments[edit]

Your guide will create a GitHub assignment for you. You'll receive an email with an invitation link.

  1. BEFORE clicking the link, sign in to GitHub using the correct account.
  2. Click the link.


Hint.pngHelpful Hint

Your guide will create assignments for you that are Private; that is, they'll be visible only to you (or your group for group assignments) and your guide. If you create any repositories on your own, be sure you select the correct setting.

Joining the Classroom Roster[edit]

The first time you click an assignment, you'll be asked to join the classroom roster. You'll see a message like, "Join the classroom roster: Your teacher has configured this classroom to pair GitHub accounts with identifiers."

  1. Click your identifier. (Do NOT skip this step.)
  2. The next page presents you with an GitHub-Acccept This Assignment Button.png. Click the Accept this assignment button.
  3. You might see a progress bar (or two). Be patient as your assignment is prepared. When the assignment is ready, you'll see the message: "You are ready to go!"
  4. A link should be ready at the very bottom of the page, immediately after the text "Your assignment has been created here:" Click that link. You'll need this link in a subsequent step in this experience.
Hint.pngHelpful Hint
The link that you just clicked is the link to your personal repository for the assignment. It might be something that you'd like to bookmark.

First GitHub Assignment[edit]

Your first GitHub assignment will be to sync all of your journals with GitHub. To do so, you'll need to specify a GitHub URL as your "remote" for your existing git repository.

Enter your Journals directory:

john-williams@codermerlin:~$ cd ~/Journals

Remember that you've already added all these files to your local git repository. You can easily verify this by checking the status.

john-williams@codermerlin:~/Digital Portfolio/CS-I/Journals$ git status

You should see something like below:

On branch master

nothing to commit, working tree clean

Let's add the remote. To do so, we'll need the URL from the above assignment. It will be something similar to:
https://github.com/.../2024-journals-JohnWilliams
Be sure to use your own url, which is unique to you.

john-williams@codermerlin:~/Journals$ git remote add origin https://github.com/.../2020-journals-JohnWilliams.git

Then, we can push our local commits to the remote server:

john-williams@codermerlin:~/Journals$ git push -u origin master

You'll then be promoted to enter your username and password. Remember to use your GitHub username and token. After the push is completed, go back to the browser and refresh the page.

Workflow Overview[edit]

Git-Workflow-Basic.png

The workflow when using a remote repository is very similar to that using only a local repository, with the exception of push and pull.

  1. add the files to the staging area
  2. commit the files to the repository
  3. push the local repository to the remote

The most significant difference is that we'll need to keep in mind that others might also be working on the remote repository, so we'll need to sync their remote changes with our local repository. The best practice is to perform a pull before beginning work in the working directory.

Tagging[edit]

As you progress through your work, whether it be code or prose, you'll accumulate more and more commits, each with its own version of a file. There will be times when you'll need to mark a specific commit. For example, you might want that commit to be reviewed by your editor or by quality assurance personnel. Git is able to mark specific points in the repository as being important. This process is called tagging, and the mark itself is called a tag. It's important to note that the entire repository at a given point in time is tagged, not one file or group of files.

Tagging Locally[edit]

A tag can be placed on the repository with the following command, replacing tagName with the actual name of the tag.

john-williams@codermerlin:~$  git tag tagName

For example:

john-williams@codermerlin:~$  git tag E1399.Outline

Pushing a Specific Tag to a Remote[edit]

To push a tag to a remote repository, use the following command:

john-williams@codermerlin:~$  git push origin tagName

For example:

john-williams@codermerlin:~$  git push origin E1399.Outline


CautionWarnIcon.png

Pushing a tag includes all required objects for that tag, but does NOT include any other references. For example, it does not include your commits. Therefore, it is vital that you first push your commits by executing the following:

john-williams@codermerlin:~$  git push

and then push any desired tags.

Deleting a Tag Locally[edit]

You can delete a tag locally by using the following command, replacing tagName with the actual name of the tag.

john-williams@codermerlin:~$  git tag --delete tagName

Deleting a Tag from a Remote[edit]

You can delete a tag from a remote with the following command, replacing tagName with the actual name of the tag.

john-williams@codermerlin:~$  git push --delete origin tagName

Best Practices[edit]

ComingSoonIcon.png
Coming Soon
  • Include only essential files required to reproduce project (e.g., source files)
  • Avoid unnecessary files (e.g., compiled products and temporary files)
  • How to use .gitignore

Key Concepts[edit]

Key ConceptsKeyConceptsIcon.png
  • GitHub is a service where we can replicate (copy) our repository and collaborate with others.
  • GitHub serves as a remote repository.
  • The workflow when using a remote repository is very similar to that using only a local repository except that additional commands are required.
    • push pushes the files from the local repository to the remote repository.
    • pull pulls the files from the remote repository to the local repository (and working directory).
    • tag marks a specific commit as 'special'.
    • push origin <tag> pushes the specified tag from the local repository to the remote repository.

Exercises[edit]

ExercisesExercisesIcon.png
  • Push all of the journals in the Journals directory to GitHub and be sure to continue to push all new/modified journals as well. Note that this applies to essays and excursions as well.
  • Journals and essays should be stored in your "Journals" directory and pushed to your "Journals" repository.
  • Exercises and excursions should be stored in your "Experiences" directory and pushed to your "Experiences" repository.
  • Your final version of any exercise must be tagged as <ExerciseName>.Final. For example, for J1006, the file will be named J1006.txt (because it is a text file) and the final version should be tagged J1006.Final

References[edit]


Experience Metadata

Experience ID W1007.10
Next experience ID
Unit Lab basics
Knowledge and skills §10.231
§10.232
Topic areas Source control systems
Classroom time 60 minutes
Study time 3 hours180 minutes <br />
Acquired knowledge understand the purpose of a source control system when working with multiple users
Acquired skill ability to push and pull changes to/from the source control system
ability to use a source control system to merge changes
ability to properly handle merge conflicts
Additional categories