2026-08-16 15:56

Status:


IBM - GSGG - Git and Github Fundamentals

==Getting Started with Git and Github

  • Overview of Git and Github:
    • Version Control- this is basically what git and github are, git is the actual version control tool, while github is just an online platform that is generally used to showcase and interact with git projects you might have
    • Pasted image 20260816160737.png
    • Pasted image 20260816160857.png
      Version Control systems generally let you track any changes that you have made to your source code, like new files or new lines inserted or deleted.
    • This lets you see who and what changes were made, and recover older versions of software if you crash something
    • Also making things a LOT easier to collab on
    • Generally Git and Github are open source software (git at least) that is made my Linux Torvalds and is under the General Public License (GNU)
    • It is a the two in combination are a version control system that can easily be used to distribute project copies between users
    • The distributed aspect of github letting you upload git projects onto it so others can download it is why it has become so big
    • Git also supports branching stradegies such as feature branching which generally allows for you to have a main code base, and then create a branch out of it that lets you work on some other feature outside of the main code. Generally, this makes it easy to add new things without breaking them
    • I myself want to use this feature to eventually add a 2-D graphics library to the Syntax for Oli-Nat programming language
    • You can use git in a CLI, but also some GUI features exist for git as well, generally letting you link it to something like github, gitlab, bitbucket, or beanstalk in order to put your version control onto the internet
    • Below are some basic terms regarding Git and Github:
    • Pasted image 20260816161343.png
    • Pasted image 20260816161420.png
  • Introduction to Github:
    • Background of Git- Linus Torvalds basically wanted to make his own open source operating system called Linux, and while working on it, he found that it was hard to organize and deal with all the different code and contributions to it
    • Therefore, he created Git as a version control tool for large projects as a way to track and control source code updates
    • Key characteristics they wanted in Git
      • Strong Support for non-linear development as they got a large number of requests for different things (these became branches)
      • Distributed Development so that way every single person who was working on the code had a method of viewing the change history
      • Compatibility with existing systems and protocols so you can integrate with whatever anyone working might like
      • Efficent handling of large projects so that way you can very easily use this for the operating system
      • Cryptographic authentication of history which makes certain that all of the given systems have safe and secure version control histories that sync sort of across systems
      • Pluggable merge strategies which allow for easy integration if someone would like a feature you have made basically
    • The reason why git was so good is because it was a distributed version-control system that allowed for you to track source code very easily and integrated good support with other programmers, letting them also partake in the version control
    • Git was so good because it was made to be used WITH other people
    • Generally, it is also good for hierarchy and team work because you have a single source of truth main branch that you can make changes to or spin offs from, letting you have freedom and collaboration while also using centralized administration
    • You can download things from the main github into a local repository on your device to see and edit the code, you can fork someone else’s code in order to basically copy it and add in your own collaboration, it is truly just a MUST for larger development and projects
  • Github Repositories:
    • You can sign up for a FREE github account simply by going over to Github’s Website where you can sign up for a free account with a username, your email and a password
    • Generally you can just join with free account but if you want some other stuff then you can choose the paid enterprise options
    • You can then verify your account via the email that they send you, and then you can go ahead and start using the account how you would like
    • Pasted image 20260816162932.png
    • You can then choose an action, whether you want to create your first repo (neat fact, if you create a YOURUSERNAME repo and then have a README.md inside of there then you can customize your profile on github, which might be fun for a first repository
    • You can also then create an organization which is basically a way to interact with a group of other people inside of github
    • Lastly, you can use the Learn how to use Github for a basic guide on the structure and features of the website service
    • To create a repository you simply create one with a button and then give it a name and other such things, then you can choose to give it some basic stuff like a readme.md or a given license, or just none of those things at all
    • You can then directly upload files from your computer using the Github website, or connect over your account to github via the CLI and upload your code from your local repository into there
    • Allowing you to update them with things like git add ., git status, git commit -m, git push and all other such things, at least after actually connecting to your online repo
  • Github - Getting Started:
    • Pasted image 20260816163452.png
    • This is basically the starter page that is given to your whenever you want to start up a new repo, it lets you choose the name of the repo, the privacy of the repo, and if you want to add things like a license, documentation, or an ignore file for future uploads
    • gitignore files are where you can input certain file types or direct file names that you want to basically exclude from your git repository, so whenever you go to upload them, they can be in your repo, but they will not be updated inside of the version history, letting you choose if you do not want things uploaded
    • README.md is general documentation for the introduction and use of your product, it is displayed at the bottom of the actual source code files in the github browser GUI
    • license this is the legal binding of how free to the public your code is, if it something like GNU then it might be open to anyone to do with it as they please, you can also have MIT which means your code is generally able to be used by anyone for research purposes, but there are more important licenses that copyright your code
    • You can also change and download files directly inside of github using their own in web text editor, and their GUI, you can then save those changes by committing them to the repo, saving them to the repo
    • Generally, this can also be done inside of your local source code using the CLI and then uploaded inside of github
    • Generally, some code editors automatically detect changes to your current git history, letting you see them in real time, also allowing you to upload them from that IDE as well
  • Summary:
      • Git is a versatile version control system used for tracking changes in code and collaborating with others on software projects.
    • Due to a distributed version control system, Git enables you to revert to the previous state or review the project’s history.
    • GitHub is one of the most popular web-hosted services for Git repositories.
    • Repositories are storage structures that store documents, including application source code, and enable contributors to track and maintain version control.
    • Git repository model
    • Primarily focused on tracking source code during development.
    • Contains elements to coordinate among programmers, track changes, and support non-linear workflows.
    • Repositories are storage structures that hold code and track version history using Git; platforms like GitHub extend these repositories with additional features such as issue tracking and collaboration tools.
    • GitHub enables you to create repositories, edit files using the web interface, commit the changes to the file, upload the files, and a lot more.

==Branches with Github

  • GitHub Branches:
    • Github Branches all files inside of Github are Stored on a branch, the main branch or the master branch generally being the ones that would store the production ready / most complete version of the code
    • Pasted image 20260816164727.png
    • This is generally only a suggestion though, any real branch is able to be used as the main branch where you host the real code of the application
    • Whenever you create a branch you essentially create an offshoot of the code that stores a given point in time, differing in commits from the main branch
    • You can create a new branch inside of your person repository through the use of the github GUI or the git CLI as well, generally changing the branch you want to start commits to. In the CLI you would do so with git branch to see what branch you are in, and then git swtich <branch-name> to then swap to a branch
    • To then create a branch in git you use git switch -c
    • Pasted image 20260816165311.png
      Branches can get to be very complicated, and so for VERY large projects, you might have a ton of different branches that are undergoing different changes at the same time in development
    • Therefore, whenever you have these to streams of code that are ready to be implemented into one you merge them and they basically become one
    • Two streams of work ready to merger are known as a tip
    • To change the contents of a file, you make a commit which generally is a change to the source code inside of commit, generally one that is considered to be good enough to be in the source code, and comes along with a comment that describes the changes
    • When making a commit you can generally also choose to make it into a new branch or add it to an existing branch
    • Generally you want to keep comments under 50 characters and not end them with a period
    • Pull Request makes the proposed (committed) changes available for others to review and use
    • You can use this to follow any commits, even if the code is unfinished
    • You can target specific users as well, letting them be the ones to review specific users
    • Github automatically makes a pull request if you make a change on a branch you do not own
    • Below is the steps are listed below:
    • Pasted image 20260816165906.png
    • The general purpose for this is because it allows for developers to keep unwanted code out of their main source code, and lets them keep the main branch as the code that is deploy-able and works
    • it also allows for senior software developers to review the junior dev code, and make sure that it runs properly as well, generally a safety feature
    • This is so changes are not released until they are committed, a pull command is issues, code is reviewed and approved, and then the code is approved and merged into main
  • Summary: Branches with Github:
    • A branch is a snapshot of your repository to which you can make changes.
    • In the child branch, you can build, make edits, test the changes, and then merge them with the main branch.
    • To ensure that changes are made by one member, do not impede or affect the workflow of other members, multiple branches can be created and merged with the main branch.
    • A pull request is a way to notify other team members of the changes and edits made to the main branch.

==Glossary

TermDefinition
BranchA separate line of development that allows to work on features or fixes independently.
CloneA local copy of the remote Git repository on the computer.
CommitA snapshot of the project’s current state at a specific point in time, along with a description of the changes made.
Continuous delivery (CD)The automated movement of software through the software development lifecycle.
Continuous integration (CI)A software development process in which developers integrate new code into the code base at least once a day.
Distributed version control system (DVCS)A system that keeps track of changes to code, regardless of where it is stored. Multiple users work on the same codebase or repository, mirroring the codebase on their computers if needed, while the distributed version control software helps manage synchronization amongst the various codebase mirrors.
ForkA copy of a repository into your GitHub account.
GitHubA web-hosted service for the Git repository.
GitHub branchesA branch stores all files in GitHub. Branches are used to isolate changes to code. When the changes are complete, they can be merged back into the main branch.
GitLabA complete DevOps platform delivered as a single application. It provides access to Git repositories, controlled by source code management.
GitFree and open-source software distributed under the GNU General Public License. It is a distributed version control system that allows users to have a copy of their own project on their computer anywhere in the world.
MergeA process to combine changes from one branch to another, typically merging a feature branch into the main branch.
Pull requestA process used to request that someone review and approve your changes before they become final.
RepositoryA data structure for storing documents, including application source code. It contains the project folders that are set up for version control.
SSH ProtocolA method for secure remote login from one computer to another.
Version controlA system that allows you to keep track of changes to your documents. This process allows you to recover older versions of the documents if any mistakes are made.
Working directoryA directory in your file system that contains files and subdirectories on your computer that are associated with a Git repository.

References