GitHub AND GIT

Git Crash Course

Pat Guillen
4 min readOct 31, 2022

Objective: Version Control set up with GIT in GitHub.

Pre Install:

Version Control: Version control is like a savings program for your project. Version control does this by tracking and logging the changes you make to your file or file sets over time. A version-control system gives you the power to review or even restore earlier versions, when properly in place. A simple explanation can be summed up as that version control takes snapshots of every revision to your project. You can then access these versions to compare or restore them as needed.

GIT: Git is a free and open-source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

User, D. (2019). Git vs. GitHub: What’s the Difference?https://devmountain.com/blog/git-vs-github-whats-the-difference/

Git: This is a version control system that lets you manage and keep track of your source code history.

GitHub: is a cloud-based hosting service that lets you manage Git repositories.

Bitbucket: Bitbucket Cloud is a Git-based code and CI/CD tool optimized for teams using Jira.

Install and set up Git

Git is a DVCS that transfers code between your local system and Bitbucket Cloud or Github.

Step 1- Install Git

Enter thegit — versionat the command line to check if you already have Git installed.

Depending on your operating system:

  • For Windows: Download the Git installer. To open a command window, go to Git Bash.vbs from the Git folder of the Programs directory.
  • For Mac: Download the Git installer. To open a command window, search for the Terminal.
  • For Linux: Enter sudo apt-get install git at the command line. To verify the installation was successful, enter which git.

Master vs Main

In the recent years since the recording of these videos, the IT community as a whole has decided to move away from certain offensive terminology. To this end, GitHub no longer uses ‘Master’ as the default name for the primary branch of a repository. You can use the following command in GitBash to correct the default naming in git.

git config --global init.defaultBranch main

And if your current repository has a Master branch, you can use the following to fix it.

git branch -m master main

Installation of GIT

The best way to avoid having to rename “master” is to set it to “main” during the installation process.
Make sure to keep this as seen above, and feel free to leave the rest of the windows set as the default.
Open GitBash

Connecting GitHub and Git

  1. Step one make a project (In this case I made a Unity Project)
Make sure to get the HTTPS — We will use this soon

2. Navigate to the folder with the project you want to upload to GitHub with GitBash. To do this using cd this

3. Make a GitHub Repo

I called mine version control.

4. git init— make sure to do this in the folder that you want to connect.

5. Add origin … git remote add origin HTTP from Github

6. Verification … git remote -v

Uploading Project to GitHub using Git

7. Pull… git pull origin main

  • Branch… git branch if you want to branch to other branches.
git pull origin main

8. Before you commit make sure to add the changes git add .→ Commit… git commit -m "message what you just did"

  • Status check… git status to know what needs to be added
  • Add all new changes… git add .

9. Push… git push origin main

Should be uploaded to your github.

Refresh your github

If you want to know more about me, feel free to connect with me on LinkedIn

--

--