Git is a version control system that allows tracking changes to files. It works by taking snapshots of files and storing reference hashes locally. There are three main stages - modified, staged, and committed. Git recommends following a workflow that involves making changes on a development branch, testing, merging to master, and pushing to a remote repository. Common commands include git add to stage changes, git commit to commit them locally, and git push to push to a remote. Branches allow parallel development, and git merge is used to integrate branches.
Version Control Systems with git (and github) as an exampleGaurav Kumar Garg
Version control systems are programs or software to manage the source code of computer programs. Most of the open source projects are now hosted on github. So learning about git and github is very much necessary to learning and start contributing to the open source projects. In this presentation I hope to get the audience introduced to the basics of version control systems and learn the basics of git.
http://shdlr.com/conferences/talk/20332
In this slide, I have a fully explanation about what is Git and why use it. I also give a fully explanation about the basic command that mostly use with git.
Version Control Systems with git (and github) as an exampleGaurav Kumar Garg
Version control systems are programs or software to manage the source code of computer programs. Most of the open source projects are now hosted on github. So learning about git and github is very much necessary to learning and start contributing to the open source projects. In this presentation I hope to get the audience introduced to the basics of version control systems and learn the basics of git.
http://shdlr.com/conferences/talk/20332
In this slide, I have a fully explanation about what is Git and why use it. I also give a fully explanation about the basic command that mostly use with git.
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
Git is a distributed revision control system that is widely used in the software development industry. The presentation was used in a lecture delivered in BITS-Pilani, India. The lecture served as a basic crash course on Git.
First, it sets off with a guide to install and configure git on various platforms.
Then, the basic working concepts of Git are explained.
This is followed by a detailed step-by-step guided demonstration of a sample workflow in Git.
Afterwards, Some auxillary commands that are frequently used are discussed briefly.
Finally, basic concepts of branching and merging are detailed.
The presentation ends with a few possible merge conflicts that occur in Git.
Diapositivas de la charla dada por la gente de uno21.com.ar (@luke_ar y @matitanio) en la UP, el día 21/08/2012. Próximamente en otras universidades :)
This slide discusses the most popular distributed version control system that is GIT and it's different commands that we need in our daily operations for project collaboration.
To introduce and motivate some best practice around version control and Git.
Resources:
https://en.wikipedia.org/wiki/Version_control
https://git-scm.com/
https://try.github.io
http://rogerdudler.github.io/git-guide/
http://ohshitgit.com/
https://www.atlassian.com/git/tutorials
https://www.datacamp.com/courses/introduction-to-git-for-data-science
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
Git is a distributed revision control system that is widely used in the software development industry. The presentation was used in a lecture delivered in BITS-Pilani, India. The lecture served as a basic crash course on Git.
First, it sets off with a guide to install and configure git on various platforms.
Then, the basic working concepts of Git are explained.
This is followed by a detailed step-by-step guided demonstration of a sample workflow in Git.
Afterwards, Some auxillary commands that are frequently used are discussed briefly.
Finally, basic concepts of branching and merging are detailed.
The presentation ends with a few possible merge conflicts that occur in Git.
Diapositivas de la charla dada por la gente de uno21.com.ar (@luke_ar y @matitanio) en la UP, el día 21/08/2012. Próximamente en otras universidades :)
This slide discusses the most popular distributed version control system that is GIT and it's different commands that we need in our daily operations for project collaboration.
To introduce and motivate some best practice around version control and Git.
Resources:
https://en.wikipedia.org/wiki/Version_control
https://git-scm.com/
https://try.github.io
http://rogerdudler.github.io/git-guide/
http://ohshitgit.com/
https://www.atlassian.com/git/tutorials
https://www.datacamp.com/courses/introduction-to-git-for-data-science
Github - Git Training Slides: FoundationsLee Hanxue
Slide deck with detailed step breakdown that explains how git works, together with simple examples that you can try out yourself. Slides originated from http://teach.github.com/articles/course-slides/
Author: https://twitter.com/matthewmccull
A Basic Git intro presentation for SVN long timers doing their first steps in Git.
This presentation is meant to clear up most of the basic concepts which cause confusion with developers using Git as if it was an SVN.
Source Code Management and Version Control Systems are tools for helping you track your file based assets (typically source code). Traditional SCM systems are centralised (CVS, Subversion, Visual Source Safe), Distributed version control systems systems provide new capabilities, work-flows, are becoming mature and are gaining mind share in the open source community.
Git is one of those Distributed Version Control Systems. It was invented by the creator of Linux (Linus Torvalds) for protecting the Linux kernel source code and coordinating the activity of hundreds of developers. This talk discusses what Distributed Version Control is, the history of Git, basic version control features and some very uncommon and amazing capabilities of git. Time permitting it will include live demonstration of the tools.
2. What is version control?
Local Version Control
Centralized Version Control
Distributed Version Control
3. What is Git
Software that stores a snapshot of your files
Everything is local to your machine
Does a SHA-1 checksum and stores that for each snapshot
5. Three sections of a git project
Working directory
Staging area
git repo
6. Installing git
Linux - yum install git-core (or apt-get install git-core)
Mac - using macports, sudo port install git-core
or browse to git-scm.com/download/mac
Windows - msysgit.github.com
post install
git config --global user.name ‘Your Name’
git config --global user.email youremail@domain.com
8. Getting started
1- Existing folder with files and no version control
git init
git add .
git commit -m “Your message here”
2- Nothing at all- Cloning an existing repo
git clone https://github.com/vinta/awesome-python.git
or git clone https://github.com/zedshaw/python-lust.git
9. What about security?
Two options:
1- Host your own server that has git on it
2- Pay github (or others) monthly and you get private repos that you can control
You control who can commit to your project even in the free github accounts
10. Workflow
1- Ensure that you are on the CORRECT branch. (This is vital later on…)
2- Make modifications to your code. (SAVE the changes.)
3- Add the files to the staging area.
4- Commit the changes to your local repo.
5- Merge your Dev branch with your Master branch.
6- Push the changes to your remote repo.
12. git status
fivestringbass:EJv2 brian$ git status
# On branch master
# Initial commit
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
# ch2exa.js
# index.htm
nothing added to commit but untracked files present (use "git add" to track)
13. git add
fivestringbass:EJv2 brian$ git add .
(You can specify particular files if someone else in your team needs them, or you
can use the period, which signifies adding everything in the current directory and
subdirectories.)
14. git status (again)
fivestringbass:EJv2 brian$ git status
# On branch master
# Initial commit
# Changes to be committed:
# (use "git rm --cached <file>..." to unstage)
# new file: ch2exa.js
# new file: index.htm
16. git status (yet again)
fivestringbass:EJv2 brian$ git status
# On branch master
nothing to commit, working directory clean
fivestringbass:EJv2 brian$
17. Wash, Rinse, and Repeat
How often to commit?
Whenever you make a major change.
18. Make changes and repeat
fivestringbass:EJv2 brian$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
# modified: ch2exa.js
no changes added to commit (use "git add" and/or "git commit -a")
19. How do I see my changes?
1)git log
2)use gitk --all (MAY need a separate install)
20.
21. .gitignore
Specifies intentional untracked files & folders that Git should ignore
.DS_Store files (if using a MAC)
data/ ( if you are processing data that is temporary)
Can use regular expressions to specify the pattern to look for
Can ignore all .php files with *.php EXCEPT you can add !index.php to have git
track changes to that one php file
22. git revert
Used to “undo” a commit.
Similar to the Previous Versions feature in Windows Server.
git revert SHA# or git revert HEAD
git reset --soft SHA# ( resets the HEAD to the point you specify but doesn’t alter
staging index or working directory)
git reset --hard SHA# (very destructive- changes staging index and working
directory to match the repo- all future changes are GONE!)
23. Remote repositories
to view: git remote -v
to add a remote: make directory (repo.git) on the remote git server, CD to it and
type “git init --bare”
then on your dev machine, cd to your folder, then type “git remote add
REMOTENAME USER@HOST:/USERNAME/REPO_NAME”
for github, it would be: git remote add github
https://github.com/bkvagnini/REPO.git
24. git branch
To see what branches are available: “git branch”
To create a new branch: “git branch develop”
To use a different branch: “git checkout develop”
To create a new branch and switch to it: “git checkout -b develop
To delete a branch: “git branch -d dev”
25. git merge
(from your develop branch, in a clean state)
git checkout master
git merge develop
git checkout develop
WRITE CODE!
merge conflicts (look for the >>> and <<< in the document)
26. Revised workflow
git fetch origin master
git pull origin master
git checkout develop
git merge master
change files
test and verify (The add to staging and commit to local repo steps are done here)
git checkout master
git merge develop
code review
git push origin master
27. git stash
Saves changes to your code in progress without committing them to the repo
git stash save “message”
git stash list (views stash changes)
28. Retrieve your stash
git stash pop stash@{0} (removes the changes from the stash)
git stash apply stash@{0} (leaves a copy in the stash)
-Deleting your stash
git stash drop stash@{0}
git stash list to confirm
Concurrent Versioning System (CVS) and Subversion (SVN) are examples of Centralized. Mercurial and Git are examples of Distributed.
demo this and show them how to get out of the man page (q)
Python Little Unix Server Toolkit
Point out the de4ed60 (it’s the first part of the 40 character SHA-1 string)
vs. git log -5 (show on vagnini.net website)
When demoing this, point out the SHA-1 ID field, reminding them of the Commit response they got back- also point out that your command line is not returned to you until you exit Wish (at least on a MAC)
Look at vagnini.net .DS_Store is for MAC, the .htm~ is for the temp files that get created when editing .htm files
Once you rewind/reset, your log won’t show you the commits- save them in a text file - can see where HEAD is via cat .git/HEAD or cat .git/refs/heads/master (shows you the SHA#)
Look in /Users/brian/Google Drive/from_dropbox/Projects/cala-learn or /learning_files/python_book (has 2 remote repos)
git remote -v github acct bkvagnini:korea hill pw http://git-scm.com/docs/git-remote
look at 24thbay website for develop vs. master branch
git branch -r (shows remote branches) or git branch -a (shows local and remote branches)
occurs mainly when two or more team members try to modify the same file at the same time
origin is this case is the name of the remote repo that you had created earlier
make a change and save it- DO NOT COMMIT- change branches- git yells at you-
Look at /from_dropbox09websites/vagnini website for stashes in the develop branch- show using gitk --all - demo pop and apply then drop - demo with git stash list