-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from CSU-CPT/fabio-git
Fabio git
- Loading branch information
Showing
9 changed files
with
106 additions
and
20 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
# What is Git? | ||
# What is Git? Why Git? | ||
|
||
### Version control | ||
|
||
Git is a version control system (VCS) that allows developers to track changes to their code over time. | ||
|
||
It basically takes a picture of what your files look like at the moment and stores a reference to a snapshot. | ||
|
||
### Code colaboration | ||
|
||
Lets say that you need to work on a coding project with your lab partner. How can both of you work on the same codebase? | ||
|
||
Git makes this possible | ||
|
||
Git is a version control system (VCS) that allows developers to track changes to their code over time. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,21 @@ | ||
# How to Install git | ||
|
||
## Linux | ||
|
||
Install it using your favourite package manager. | ||
|
||
`$ sudo apt-get install git-all` | ||
|
||
## MacOS | ||
|
||
MacOS will already have git installed by default. | ||
|
||
## Windows | ||
|
||
1. Go to the latest [Git Windows installer](https://gitforwindows.org/) and download the latest version. | ||
|
||
2. Follow the instructions as provided by the installer wizard. | ||
|
||
3. Open the windows command prompt. | ||
|
||
4. Type `git version` to verify Git was installed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,51 @@ | ||
# Using git | ||
|
||
## How does it work? | ||
|
||
You will first create what is called a repository, this is the place where your code will be. | ||
|
||
In our case main will be our master repository. This is the main code that will be used. | ||
|
||
### Branches | ||
|
||
From this main code you can create branches, this allows you to make changes without the chance of ruining the main code. Think of it as a copy of your code that you can now change with zero risks. | ||
|
||
Use this command to create a new branch: | ||
|
||
`git checkout -b "name_of_the_branch"` | ||
|
||
To switch branches | ||
|
||
`git checkout "name_of_the_branch"` | ||
|
||
![Drawing-0](./images/IMG_36D4CB635079-1.jpeg) | ||
|
||
### Staging | ||
|
||
Once we made some changes we will want to commit them, before we can do that we want to stage the files. This is like another layer to saving your files. This is so if you have two files you changed but only one is ready to commit, you can select the file to stage. | ||
|
||
To stage your file run this command: | ||
|
||
`git add file_name/folder_name` | ||
|
||
TIP: | ||
|
||
use this command to see the changes made. | ||
|
||
`git status` | ||
|
||
### Committing | ||
|
||
Creating a commit creates a snapshot of all the staged files | ||
|
||
TIP: For commit messages do you not use past tense, such as "I made headings blue". Use language like "Make headings blue", as if you are giving orders to the codebase. | ||
|
||
This command creates a commit: | ||
|
||
`git commit -m "description of the commit"` | ||
|
||
![Drawing-1](./images/IMG_23DAA7999A27-1.jpeg) | ||
|
||
A good way of visualizing how this works | ||
|
||
![Drawing-2](./images/IMG_96E3138F72ED-1.jpeg) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters