|
||
Wikipedia defines Git as:
Git is a version control system for tracking changes in computer files and coordinating work on those files among multiple people. It is primarily used for source code management in software development, but it can be used to keep track of changes in any set of files. As a distributed revision control system it is aimed at speed, data integrity, and support for distributed, non-linear workflows.
Wikipedia defines Git as:
Git is a version control system for tracking changes in computer files and coordinating work on those files among multiple people. It is primarily used for source code management in software development, but it can be used to keep track of changes in any set of files. As a distributed revision control system it is aimed at speed, data integrity, and support for distributed, non-linear workflows.
Wikipedia defines Version Control System as:
… version control is the management of changes to documents, computer programs, large web sites, and other collections of information. Changes are usually identified by a number or letter code, termed the “revision number“ … Each revision is associated with a timestamp and the person making the change. Revisions can be compared, restored, and with some types of files, merged.
Wikipedia defines Version Control System as:
… version control is the management of changes to documents, computer programs, large web sites, and other collections of information. Changes are usually identified by a number or letter code, termed the “revision number“ … Each revision is associated with a timestamp and the person making the change. Revisions can be compared, restored, and with some types of files, merged.
Which means:
Git is a version control system which manages changes to collections of information. The changes are identified by a number, timestamp and the person making the change. It is aimed at speed and data integrity and supports distrubuted workflows.
or |
Chocolatey Home Page - https://chocolatey.org
Install Chocolatey - https://chocolatey.org/install
Git Tools
Download from https://gitforwindows.org
> choco install git -y
Git Tools
Download from https://git-scm.com/download/mac
$ brew install git
Git Tools
|
|
|
Visual Studio Code
https://code.visualstudio.com/docs/setup/setup-overview
> choco install vscode -y
$ brew cask install visual-studio-code
$ # See setup URL for options
GitEx
> choco install gitextensions -y
Git Credential Manager For Windows
> choco install git-credential-manager-for-windows -y
> choco install vscode-gitlens -y
GitHub Pull Requests
posh-git
https://github.com/dahlbyk/posh-git
ps-git
last updated 2017
Version Control Systems | |||
Unlimited Public Repos | |||
Unlimited Private Repos | * | ||
CI / CD | * | ||
(Subjective) Popularity |
Developers, Coders and Scripters. |
Writers and Authors. |
Websites. |
CI / CD, Runbooks, Cookbooks and Playbooks. |
Change history. The who, when and what. |
Undo changes made you or others. |
Collborate with others across your organisation, group or world. |
Open Source community. |
repository |
Simply think of it as a folder that can hold your projects files and folders.
The terminology repo and repository are used interchangeably. |
|
Downloads a copy of the repository to your local computer. | |
|
Get the remote URL(s) for the repository. |
|
clone the repository by downloading it to your local computer. | |
|
Get the remote repository URL(s). |
$ git clone https://github.com/psdevopsug/git-fundamentals-demo
Cloning into 'git-fundamentals-demo'...
remote: Enumerating objects: 12, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 93 (delta 0), reused 11 (delta 0), pack-reused 81
Unpacking objects: 100% (93/93), done.
$ git remote # not helpful
origin
$ git remote --verbose # helpful
origin https://github.com/psdevopsug/git-fundamentals-demo (fetch)
origin https://github.com/psdevopsug/git-fundamentals-demo (push)
? |
|
Get the status of the repository on the local computer. |
|
Show the differences / changes made. | |
|
Add changes to staging. | |
|
Commit changes from staging. | |
|
Push changes committed to remote repository. |
|
|
|
|
Make changes. | Stage changes. | Commit changes. | Push / upload changes. |
unstaged | staged | committed | pushed |
$ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working
directory)
modified: setup.ps1
no changes added to commit (use "git add" and/or "git commit -a")
$ git diff
git diff setup.ps1
diff --git a/setup.ps1 b/setup.ps1
index f6eaccb..06bdde5 100644
--- a/setup.ps1
+++ b/setup.ps1
@@ -1 +1 @@
-cd c:\windows
+gci c:\windows
$ git add setup.ps1
$ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: setup.ps1
git commit --message 'Add setup file'
[master 10ca799] Add setup file
1 file changed, 1 deletion(-)
git push origin
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Writing objects: 100% (3/3), 653 bytes | 217.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/psdevopsug/git-fundamentals-demo
6759a23..f1f3e8b master -> master
branch | A child branch is a point-in-time snapshot of it’s parent. A branch can exist on it’s own or can be brought back into the parent. |
$ git checkout -b fix-alias
Switched to a new branch 'fix-aliases'
# modify the setup.ps1 to remove the aliases
$ git status
On branch fix-aliases
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working
directory)
modified: setup.ps1
no changes added to commit (use "git add" and/or "git commit -a")
# modify the setup.ps1 to remove the aliases
$ git commit --message 'Removed the alias'
[fix-aliases cef2274] Removed the alias
1 file changed, 1 insertion(+), 1 deletion(-)
$ git push origin # we get an error message!
fatal: The current branch fix-aliases has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin fix-aliases
$ git push --set-upstream origin fix-aliases
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Writing objects: 100% (3/3), 674 bytes | 224.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote:
remote: Create a pull request for 'fix-aliases' on GitHub by
visiting:
remote: https://github.com/psdevopsug/git-fundamentals-demo/
pull/new/fix-aliases
remote:
To https://github.com/psdevopsug/git-fundamentals-demo
* [new branch] fix-aliases -> fix-aliases
Branch 'fix-aliases' set up to track remote branch 'fix-aliases'
from 'origin'.
fork | A copy of a repository that keeps a link to the original URL it was copied from. |
pull request | A request to a project to pull your code in for review and merging. Changes are made on a fork of the project repository and the pull request created from that fork. |
Contributing Guidelines
CONTRIBUTING.md
CONTRIBUTERS.md
COMMITTERS.md
See Chocolatey CONTRIBUTING.md file as an example.
Contributor License Agreement
A legal document;
Ensures you are entitled to contribute the code/documentation/translation to the project;
Should there be any kind of legal issue then the project has confirmation that you were permitted to make this contribution.
Etiquette
Match the style of the project code or documentation;
Project maintainers likely volunteers - manage your expectations;
Have respect!
Use common sense;
What Git is;
What tools I need to work with Git;
Who is using Git and I can use it for;
Fundamental building blocks of Git;
Basic commands to work with Git;
The three stages of Git;
What a pull request is and why we use them;
Pull Request process flow;
Congratulations!
You’re now a git too!
https://blog.pauby.com | Paul Broadwith | |
@pauby | ||
github.com/pauby | ||
linkedin.com/in/paulbroadwith |
pau.by/talks