Here Don goes over some of the benefits of using GIT as well as some of the basic concepts and methods. Later he goes through the workflow of using GIT. Download his slides here or email him at dlee@tagged.com.
A Brief Introduction to Working with GitPhilip Langer
This slide deck is intended for Git beginners and focuses on the underlying concepts, the usage of the command line, especially the commands git reset, git checkout, git revert, git commit, and eventually introduces models for using Git and why git rebase may play an important role in some those models.
Advanced Web Development in PHP - Code Versioning and Branching with GitRasan Samarasinghe
ESOFT Metro Campus - Advanced Web Development in PHP - (Module III) Code Versioning and Branching with Git
(Template - Virtusa Corporate)
Contents:
Introduction to Git
What is Version Controlling?
What is Distributed Version Controlling?
Why Use a Version Control System?
Downloading and Installing Git
Git Life Cycle
Init command
Clone Command
Config Command
Add Command
Commit Command
Status Command
Log Command
Diff Command
Revert Command
Reset Command
Clean Command
Commit --amend Command
Rebase Command
Reflog Command
Branch Command
Checkout Command
Merge Command
Remote Command
Fetch Command
Pull Command
Push Command
Git and github - Verson Control for the Modern DeveloperJohn Stevenson
An introduction to Git and Github, tools for distributed version control that give an easy to use and highly collaborative approach to version code and configuration.
A Brief Introduction to Working with GitPhilip Langer
This slide deck is intended for Git beginners and focuses on the underlying concepts, the usage of the command line, especially the commands git reset, git checkout, git revert, git commit, and eventually introduces models for using Git and why git rebase may play an important role in some those models.
Advanced Web Development in PHP - Code Versioning and Branching with GitRasan Samarasinghe
ESOFT Metro Campus - Advanced Web Development in PHP - (Module III) Code Versioning and Branching with Git
(Template - Virtusa Corporate)
Contents:
Introduction to Git
What is Version Controlling?
What is Distributed Version Controlling?
Why Use a Version Control System?
Downloading and Installing Git
Git Life Cycle
Init command
Clone Command
Config Command
Add Command
Commit Command
Status Command
Log Command
Diff Command
Revert Command
Reset Command
Clean Command
Commit --amend Command
Rebase Command
Reflog Command
Branch Command
Checkout Command
Merge Command
Remote Command
Fetch Command
Pull Command
Push Command
Git and github - Verson Control for the Modern DeveloperJohn Stevenson
An introduction to Git and Github, tools for distributed version control that give an easy to use and highly collaborative approach to version code and configuration.
GitHub is a Git repository hosting service, but it adds many of its own features. While Git is a command line tool, GitHub provides a Web-based graphical interface. It also provides access control and several collaboration features, such as a wikis and basic task management tools for every project.
A Git Workflow is a recipe or recommendation for how to use Git to accomplish work in a consistent and productive manner. Git workflows encourage users to leverage Git effectively and consistently.
Check out this highlight training from the Automat-IT University trainers.
What is new in Go 1.8, and what is expected to come in the Go 1.9 release. Presented at the Golang-Brno meetup group on Feb 28th, 2017.
https://www.meetup.com/Golang-Brno/events/237697083/
Introduction To Git For Version Control Architecture And Common Commands Comp...SlideTeam
Introduction To Git For Version Control Architecture And Common Commands Complete Deck is an impact virtual tool. Employ our PowerPoint presentation to acquaint your audience with the version management system. This PPT slideshow is ideal to effectively elucidate GIT version control software through the visual aid of industry-best diagrams. Elaborate on the need for GIT by your organization. Consolidate the advantages of the GIT distributed version control application using our PowerPoint layout. Data visualizations featured in this PPT template deck facilitate a better explanation of the GIT architecture. You can also convey the features of this distributed revision control tool. Compile the common commands used in GIT with appreciable ease. Present vital information about the revision control system such as working with remote repositories by the means of our PowerPoint format. This is a must-have virtual solution, especially for upper and mid-level management. So, hit the download icon now and instantly start building an impressive presentation. https://bit.ly/3nMK6c4
Matthew McCullough of GitHub presented on why Java developers have so many reasons to explore Git and Git, including productivity gains, easy OSS contributions, the eGit Eclipse plugin, and JGit, the underlying Java cleanroom implementation that powers https://android.googlesource.com.
Delivered on June 9, 2012
Alex Muresan and Nalin DeZoysa give a high-level presentation on what Node.js is and how it works. They also show a live Tagged application of Node.js and how to use realtime for your app.
GitHub is a Git repository hosting service, but it adds many of its own features. While Git is a command line tool, GitHub provides a Web-based graphical interface. It also provides access control and several collaboration features, such as a wikis and basic task management tools for every project.
A Git Workflow is a recipe or recommendation for how to use Git to accomplish work in a consistent and productive manner. Git workflows encourage users to leverage Git effectively and consistently.
Check out this highlight training from the Automat-IT University trainers.
What is new in Go 1.8, and what is expected to come in the Go 1.9 release. Presented at the Golang-Brno meetup group on Feb 28th, 2017.
https://www.meetup.com/Golang-Brno/events/237697083/
Introduction To Git For Version Control Architecture And Common Commands Comp...SlideTeam
Introduction To Git For Version Control Architecture And Common Commands Complete Deck is an impact virtual tool. Employ our PowerPoint presentation to acquaint your audience with the version management system. This PPT slideshow is ideal to effectively elucidate GIT version control software through the visual aid of industry-best diagrams. Elaborate on the need for GIT by your organization. Consolidate the advantages of the GIT distributed version control application using our PowerPoint layout. Data visualizations featured in this PPT template deck facilitate a better explanation of the GIT architecture. You can also convey the features of this distributed revision control tool. Compile the common commands used in GIT with appreciable ease. Present vital information about the revision control system such as working with remote repositories by the means of our PowerPoint format. This is a must-have virtual solution, especially for upper and mid-level management. So, hit the download icon now and instantly start building an impressive presentation. https://bit.ly/3nMK6c4
Matthew McCullough of GitHub presented on why Java developers have so many reasons to explore Git and Git, including productivity gains, easy OSS contributions, the eGit Eclipse plugin, and JGit, the underlying Java cleanroom implementation that powers https://android.googlesource.com.
Delivered on June 9, 2012
Alex Muresan and Nalin DeZoysa give a high-level presentation on what Node.js is and how it works. They also show a live Tagged application of Node.js and how to use realtime for your app.
Tagged Development workshops are weekly workshops to promote development best practices and learn about how product and infrastructure gets built. Half an hour presentations, followed by Q&A.
General introduction of Git and its feature set. Subversion migration strategies using git-svn, subgit or github enterprise. Suitable for different audience types managers, developers, etc.
A brief description of why decentralised version control (Git, Mercurial, etc) is superior to centralised version control (SVN, CVS, etc), written with SVN users in mind.
136 ultra-fast slides, 10-20 minutes of presentation
Git is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.
This PPT describes most used commands.
A small presentation for developers with good SVN knowledge that are going to working with Git.
The presentation also contains an example of repository creation on github and a simple scenario of collaboration between two developers
Git is an important part of daily programming (especially if you're working with a team) and is widely used in the software industry. Since there are many various commands you can use, mastering Git takes time. But some commands are used more frequently (some daily). So in this post, I will share and explain the most used Git commands that every developer should know. Note: To understand this PDF, you need to know the basics and advances of Git. https://www.9series.com/
A Beginner's Guide to Git and GitHub, CLI version.
What is Git?
What is Github
Basic commands
Difference between Central and Distributed Version Controlling System
Welcome to the Program Your Destiny course. In this course, we will be learning the technology of personal transformation, neuroassociative conditioning (NAC) as pioneered by Tony Robbins. NAC is used to deprogram negative neuroassociations that are causing approach avoidance and instead reprogram yourself with positive neuroassociations that lead to being approach automatic. In doing so, you change your destiny, moving towards unlocking the hypersocial self within, the true self free from fear and operating from a place of personal power and love.
2. What is GIT
(local) GIT ===> SVN/GIT (repo)
● GIT is a distributed version control system (DVCS).
● Our repo can be SVN or GIT
● It only interface with SVN when
○ read ==> sync to repo
○ write ==> submit to repo
● With GIT, all changes are store locally.
● SVN repo (svn://svn.tagged.com)
● GIT repo (https://git.tagged.com/git)
3. GIT Vs SVN
● Git clone (url) gives you a complete copy of
the entire history of that project.
● Every operation is now done off data on
your local disk, meaning that it is both
unbeliveably fast and can be done offline.
● No single point of failure (such as SVN
server crash), everyone has full backup of
the project data.
● It doesn't depend on 1 centralized server,
you can add multiple remote repositories to
your project.
4. Three States
● HEAD - last commit snapshot, local repo
● Index - proposed next commit snapshot
● working directory (WD) - sandbox
5. Installation
● Linux - sudo apt-get install git-core
-sudo apt-get install git-svn
● Mac OS - Download and install from HERE.
● Windows 7 - Install cywin and enable git*, svn*, perl*, python,
wget packages where * means wild card
Configuration
1. Open a terminal and create a .gitconfig file in your home directory
and then add/edit ~/.gitconfig file as follows:
6. [user]
name = Don Lee
email = dlee@tagged.com
[reviewboard]
url = https://scm.tagged.com/reviewboard
[alias]
ci = commit
up = update
st = status
br = branch
co = checkout
di = diff
lg = log --graph --decorate
gl = log -p
glp = log --graph --oneline --abbrev-commit --decorate
rl = reflog
llog = log --date=local
ol = log --oneline
w = whatchanged
sta = stash
rb = !post-review --parent=trunk --guess-description --username=dlee -o
rb-diff = !post-review -n --parent=trunk
sdiff = !git-svn-diff
[log]
date = local
[color]
ui = auto
[color "diff"]
whitespace = red reverse
[core]
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
7. Review Board Setup
1. Download any one of the TAR file in http://downloads.
reviewboard.org/releases/RBTools/0.3
2. Extract the files into home directory
3. mv <folder name> RBtools
4. cd ~/RBtools
5. python setup.py install
6. mv <downloaded EGG file> RBtools.egg
7. easy_install RBtools.egg
8. Download git-svn-diff from: https://gist.github.com/44537 and
add it somewhere in your PATH.
Note:
Linux users can install python by
apt-get install python-setuptools
For Windows 7 user, in order to get "apt-get", use apt-cyg instead
svn --force export http://apt-cyg.googlecode.com/svn/trunk/ /bin/
chmod +x /bin/apt-cyg
8. Getting SVN/GIT repo
git svn clone <repo url> <target directory>
Example:
git svn clone svn://svn.tagged.com/web/trunk .
It is getting the repo from web project to current
directory.
Note: For GIT Repo, use
git clone ssh://username@git.tagged.
com/git/engteam/<project name>.git
9. Getting the repo (con't)
A faster way to get repo is to copy all the directory/files
from a colleague who is already migrated to GIT, and
then issue the command above to sync to with the repo
10. Sync to SVN/GIT repo
git svn rebase
This will sync your branch to the latest version in the
SVN repo.
Note: For user with GIT repo, use the following
instead
git pull
11. Branching
git br <new branch name>
This command creates a new branch and it would have
the same version as the master branch. If you don't input
a name, it will just show you existing branch.Ex:
git br newBranch
12. Switching branch
git co <branch name>
This command switch to a another branch. Please try to do changes on the
branch and leave the master clean because most likely you are doing diff with
the master branch later.
Example:
git co newBranch
git br
output:
master
* newBranch (notice the * has change to point to newBranch)
There is a combo command which let you create a new branch AND switches
to the new branch
git co -b newBranch
13. Add a file
git add <filesnames>
This command add files to index.
Example:
git add shared/class/tag/{dao/a.php,b.php}
This command will add to files a.php in dao subdirectory
and b.php
14. Remove file
git rm <filesnames> remove files in index
git rm <filename> --cached remove from staging,
file still exists
Example:
git rm shared/class/tag/{dao/a.php,b.php}
This command will remove files a.php in dao
subdirectory and b.php
15. Moving file
git mv <filesnames> <destination file location>
This command moves files in index.
Example:
git mv shared/class/tag/a.php .
This command will move file a.php to current directory.
16. Checking status
git st
This command displays the changes so far in the working
directory i.e. what file are modified.
Reverting mistake
git reset --soft commit_id move HEAD to commit id
git reset commit_id move HEAD & index to commit id
git reset --hard commit_id move ALL to commit id
commit_id if not supply means HEAD. For example git reset will
unstage files in index to working dir
17. Reverting mistake
git co commit_id <filename>
Change a working directory file to the a version specify by commit
id. If not specified, Ex: git co, it means get HEAD version of all files
in current dir.
git co -- <filename or path>
Clear working directory for specific file or specific path (recursively)
git reset HEAD <filename>
Unstage a file
git revert HEAD
Creates "another" new commit that revert earlier change.
18. Ignoring file
cd ~
vim .gitignore
list out the full path of the filename to ignore
git config --global core.excludesfile ~/.gitignore
It ignore any files you may want the GIT to ignore.
19. Stashing
git sta save "a name identifier"
If you are not ready to commit stuff, but you need to save
the stuff that are modify, use the command above.
git sta list
to look at all the save list
git sta apply <optional nth list>
This would just dump out the specific stash.Example:
git stash apply stash@{0}
20. Commit change
git ci -a commit all index and WD to branch
git ci commit only index to branch
git ci -m "blah" commit with commit message "blah"
git ci --amend modify the existing commit
Diffing
git di diff WD and index
git di --cached diff index and HEAD
git di master newbranch diff between branches
21. Inspect commits
git lg List all the commit ids and description in that branch in decending order with
the latest commit at the top. The argument can be compound.
git gl Show the code diff as well
git lg -2 Show only last 2
git glp Show 1 line for each commit
git lg --since=2.weeks last 2 weeks
git lg --since="2011-09-01" since September 1st 2011
git lg --until="2011-09-01" until September 1st 2011
git lg --author="dlee" author is dlee
git lg --committer="dlee" committer is dlee
git show <commit id>
output:
{all the code diff for the particular commit}
22. Inspect Git Log
git rl List all the actions you did in git
Remote Repo URL
git remote -v List all the remote repo URL
Find the culprit
git blame <filename> List all the people who change the file.
23. Merging change
git merge <branch name to merge into >
Merges the branch name to the current branch.
Conflict
Git will try to auto-resolve a conflict if it can, however, when it fails to do so,
you can use a conflict resolve tool, there are several out there, one good one
is meld.
git mergetool
trigger a interactive UI where you can click on which one you want to
merge.
24. Interactive mode
git rebase -i HEAD~<no. commit involved>
This will trigger interactive mode which will allow you
to play with the commit message, squash serveral
commits into 1.
# Rebase a257c40..90a4507 onto a257c40
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
#
# If you remove a line here THAT COMMIT WILL BE LOST.
# However, if you remove everything, the rebase will be aborted.
25. Interactive mode (con't)
Squashing serveral commit into 1
git rebase -i HEAD~ <no. of commits>
Example:
pick 90a4507 pick me
pick 90a4508 squash me
pick 90a4509 squash me
change to
pick 90a4507 pick me
s 90a4508 squash me
s 90a4509 squash me
and then save.
In the next pop-up just put a "#" on the comments you don't want.
26. Interactive mode (con't)
Reverting a file from latest commit while in a branch
git co master <filename>
git commit -a
git rebase -i HEAD~2 squash the two commit
into one.
Note there is an easier way:
git co master <filename>
git commit --amend
Checkout the master copy of filename, commit it into the branch and
then squash the commits.
27. Creating patch
git format-patch <commit id> ~ <no. of commit>
If you changes is the latest commit, commit id shall be
HEAD.
git rb-diff > patch.diff
This creates a SVN patch diff.
28. Apply patch
git apply <the diff file>
apply the changes by others.
Please note this doesn't work with existing svn diff
patch file.
29. Review Board
post-review
Submitting code review to review board is easy with just type the
command above. However, you still need to enter the group, review
name and etc. The diff portion is handled for you already. (Note for
GIT-repo, you might need to remove --parent=trunk in .gitconfig)
post-review -r <revision number in RB>
If you want to update diff in review board, just is type the command
above with the revision number in RB.
30. Push to SVN or GIT
git svn dcommit
this shall submit the changes to the SVN repo.
Note: For GIT Repo user, use the following command instead
git push
Deleting branch
git br -D <newBranch>
You work is done, remove the temp branch.
31. Need help ?
git help <command>
If you don't specify the command name, it will just list out all
the commands that are available.
32. FAQ
1) After unpacking the source code and syncing the latest, git st gives a list of changes which I did not modify.
resolution: git reset --hard
2)Win 7 user, I get a call stack crash stating remap error when I issue a git svn rebase.
resolution: Close out of Cygwin (and all cygwin processes) , go to your cygwin bin directory, and type ash '/usr/bin/rebaseall'
3) Why do I get the error ? update-index --refresh: command returned error: 1
resolution: You need to either save your current changes using stash (i.e. git sta save <name>) or commit your changes (i.e. git ci -a) before
you can sync with repo.
4) How do I commit my changes to repo if I have several commits ?
resolution: Git only commit your latest changes, You can squash several commit into one latest commit before submitting to repo.
5) How do I see the commits in my local branch ?
resolution: git lg
33. Free Assistance
For those who are interested to transition to GIT
next week (limited time offer), we will sit with you
and help you to set up.
Don, dlee@tagged.com
Nate, nkresge@tagged.com