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.
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.
Introduction to Gitlab | Gitlab 101 | Training SessionAnwarul Islam
I actually described in this slide how to use Gitlab with git. I explained what is git, push, pull, clone, commit etc. so, you can use this slide to learn or tech someone.
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.
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.
Introduction to Gitlab | Gitlab 101 | Training SessionAnwarul Islam
I actually described in this slide how to use Gitlab with git. I explained what is git, push, pull, clone, commit etc. so, you can use this slide to learn or tech someone.
Version control systems are a category of software tools that help a software team manage changes.
Git is a very well supported open source project.
Git is a mature, actively maintained open source project
originally developed in 2005 by Linus Torvalds.
Two days git training with labs
First day covers git basis and essential commands
Second day covers git additional command with a big lab using a git workflow
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.
Build an application upon Semantic Web models. Brief overview of Apache Jena and OWL-API.
Semantic Web course
e-Lite group (https://elite.polito.it)
Politecnico di Torino, 2017
Version control systems are a category of software tools that help a software team manage changes.
Git is a very well supported open source project.
Git is a mature, actively maintained open source project
originally developed in 2005 by Linus Torvalds.
Two days git training with labs
First day covers git basis and essential commands
Second day covers git additional command with a big lab using a git workflow
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.
Build an application upon Semantic Web models. Brief overview of Apache Jena and OWL-API.
Semantic Web course
e-Lite group (https://elite.polito.it)
Politecnico di Torino, 2017
"Pizza with the Pros" at Heartland CC 28MAR17CBCT Magazine
Little presentation I used at the 28MAR17 "Pizza with the Pros" at Heartland Community College in Normal, Illinois, USA to give "shout-outs" to people/companies I collaborate with and support! Wanted to show staff/students what is possible in 3DP/AM as start-up small business entrepreneurs!
Lezione tenuta presso l' I.I.S.S. "A. De Pace" di Lecce durante il Modulo "Media on the Web - Web Tv and Media Channel" con le Classi 4ATA e 4BTA indirizzo Audiovisivo. Tutor del modulo è il prof. A. Nicolì.
Regards the LED lights gradual mature, More and more business field needs the UV light for special, also in mushroom field. The so-called UV LED mostly with 365~395nm.
Oportunidad de negocios en la distribución de planes de pensión internacionalesPrime Financial Advisors
Tenemos interés en contactar agentes y agencias interesadas en distribuir planes de pensión en su país. Estos planes son ofrecidos por una importante aseguradora Europea. Si usted tiene interés agradeceré complete el formulario que se encuentra en este enlace: https://goo.gl/ioKoUm
Gracias por su atención.
P.D. Sólo se ofrece esta distribución en los países en los que no esté expresamente prohibido ofrecer este tipo de productos.
Send SMS Surveys to your Clients and Candidates Pre and Post-InterviewMediaburst
Use SMS surveys to ask for feedback from your clients and candidates either during the recruitment process or once a position has been filled. Send surveys directly from your SurveyMill account or use our clever API.
Metz lab Pvt.Ltd. conducting courses and give practical training for engineers about metallurgy.
Basis Metallurgy
Heat treatment
Failure analysis
Selection of materials
Metallurgical testing
Engineering materials
Surface engineering
Castings and Forgings defects
apart from that customized training also given based on special request by the customers
One of the biggest advantages of Git is its branching capabilities. Unlike centralized version control systems, Git branches are cheap and easy to merge. This facilitates the feature branch workflow popular with many Git users.
Git Bash is a command line interface that allows you to interact with Git, a version control system that tracks changes in your code and lets you collaborate with other developers. Git Bash is based on a popular Unix shell called Bash, and it works on Windows operating systems. With Git Bash, you can create and manage Git repositories, stage and commit your code, push and pull from remote servers, create and merge branches, and much more. In this article, I will give you an introduction to Git Bash and show you how to use some basic commands. ¹²³
المصدر: محادثة مع Bing، 29/9/2023
(1) Git bash: Definition, commands, & getting started | Atlassian. https://www.atlassian.com/git/tutorials/git-bash.
(2) An introduction to Git: what it is, and how to use it - freeCodeCamp.org. https://www.freecodecamp.org/news/what-is-git-and-how-to-use-it-c341b049ae61/.
(3) Introduction to Git Bash: A Beginner's Guide to Using the Command Line .... https://marketsplash.com/tutorials/git/git-bash/.
(4) undefined. https://git-scm.com/book/en/v2/Getting-Started-Installing-Git.
Introduction to Git and Github - Google Developer Student Clubs CET, TrivandrumAbhijitNarayan2
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. This will be a beginner friendly session where we will explain to you how Git and Github works and how to use it for your future projects as well!
Git 101 - Crash Course in Version Control using GitGeoff Hoffman
Find out why more and more developers are switching to Git - distributed version control. This intro to Git covers the basics, from cloning to pushing for beginners.
GitHub is a web-based hosting service for version control using git. It is mostly used for computer code. It offers all of the distributed version control and source code management (SCM) functionality of Git as well as adding its own features. It provides access control and several collaboration features such as bug tracking, feature requests, task management, and wikis for every project
Git is a distributed version-control system for tracking changes in source code during software development.
GitFlow is a branching model for Git which is very well suited to collaboration and scaling the development team.
Introduction to the Python programming language (version 2.x)
Ambient intelligence: technology and design
http://bit.ly/polito-ami
Politecnico di Torino, 2015
PowerOnt: an ontology-based approach for power consumption estimation in Smar...Luigi De Russis
Presentation given at the 1st Cognitive Internet of Things Technologies (COIOTE 2014)
October 27, 2014, Rome, Italy
The paper is available on the PORTO open access repositor of Politecnico di Torino: http://porto.polito.it/2570936/
Short seminar about the Semantic Web for the "Artificial Intelligence" course at Politecnico di Torino (academic year 2012/2013)
An updated version is available at http://www.slideshare.net/luigidr/semantic-web-an-introduction
An overview on social network technologies: are they "typical" website? Or do they work in a different way? How many and what technologies do Facebook and Instagram use?
Presentation made for the Multimedia Languages and Environments course at Politecnico di Torino (academic year 2013/2014).
A brief overview about writing clean code. Presentation made for the Multimedia Languages and Environments course at Politecnico di Torino (academic year 2012/2013).
dWatch: a Personal Wrist Watch for Smart EnvironmentsLuigi De Russis
Presentation given at the 3rd International Conference on Ambient Systems, Networks and Technologies
August 27-29, 2012, Niagara Falls, Ontario, Canada.
The paper is available on the PORTO open access repository: http://porto.polito.it/2496719/
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
2. How do you share and save data?
• “I’m working solo… and I only have one
computer”
3/13/2015 Version Control with Git 2
What I need:
- backup;
- different saved versions;
- early and frequently
saving.
What I can use:
- external hard drives;
- dedicated folder;
- Dropbox folder;
- …
3. How do you share and save data?
• “I’m working solo… and I only have one
computer”
3/13/2015 Version Control with Git 3
What if…
- … I forget to save a specific version
and then I need it?
- … I delete/loose a previous version?
4. How do you share and save data?
• “I’m working solo… and I have more than one
computer”
3/13/2015 Version Control with Git 4
What I need:
- backup;
- different saved versions;
- early and frequently saving;
- conventions on file names.
What I can use:
- USB memory sticks;
- external hard drives;
- Dropbox folder;
- shared folder;
- …
5. How do you share and save data?
• “I’m working solo… and I have more than one
computer”
3/13/2015 Version Control with Git 5
What if…
- … I forget to save a specific version
and then I need it?
- … I delete/loose a previous version?
- … I have different projects in the
“shared” workspace?
- … I forget to copy one version
between computers?
6. How do you share and save data?
• “I’m working in team”
3/13/2015 Version Control with Git 6
What I need:
- backup;
- different saved versions;
- early and frequently saving;
- shared conventions on file
names.
What I can use:
- USB memory sticks;
- external hard drives;
- Dropbox folder;
- e-mails;
- …
7. How do you share and save data?
• “I’m working in team”
3/13/2015 Version Control with Git 7
Other issues:
- who has the latest version?
- who has the right to edit?
- how to ensure that everyone
sees up-to-date versions of
everything?
- how to handle conflicts?
What if…
- … a team member forgets to save a
specific version and then someone
else needs it?
- … someone deletes/looses a version?
- … someone forgets to share a specific
version of the projects?
8. Version Control Systems
Three generations:
1. Local (RCS, SCCS)
2. Centralized (CVS, Subversion, Team Foundation
Server)
3. Distributed (Git, Mercurial)
3/13/2015 Version Control with Git 8
Record changes to a file or a set of files over time so that
you can recall specific versions later
NOW
9. Basic Concepts
Repository
– place where you store all your
work
– contains every version of your work that has ever
existed
• files
• directories layout
• history
– can be shared by the whole team
3/13/2015 Version Control with Git 9
10. Basic Concepts
Working copy
– a snapshot of the repository used
for… working
– the place where changes happens
– private, not shared by the team
– it also contains some metadata so that it can keep
track of the state of things
• has a file been modified?
• is this file new?
• has a file been deleted?
3/13/2015 Version Control with Git 10
11. Basic Concepts
Commit
– the operation that
modifies the repository
– atomically performed by modern version control
tools
• the integrity of the repository is assured
– it is typical to provide a log message (or comment)
when you commit
• to explain the changes you have made
• the message becomes part of the history of the repository
3/13/2015 Version Control with Git 11
12. Basic Concepts
Update
– update the working copy
with respect to the
repository
• apply changes from the repository
• merge such changes with the ones you have made to your
working copy, if necessary
3/13/2015 Version Control with Git 12
13. Centralized Version Control
• one central repository
• client-server relationship
3/13/2015 Version Control with Git 13
14. Distributed Version Control
• clients and server have the full copy of the repository
– local repositories clone a remote repository
• it is possible to have more than one server
3/13/2015 Version Control with Git 14
15. More Basic Concepts
Push
– copy changesets from a
local repository instance
to a remote one
• synchronization between two repository instances
3/13/2015 Version Control with Git 15
16. More Basic Concepts
Pull
– copy changesets from a
remote repository
instance to a local one
• synchronization between two repository instances
3/13/2015 Version Control with Git 16
17. Introducing… Git
• Distributed Version Control System
• Born
– on 2005 for the Linux kernel project
– to be used via command line
• Website: http://git-scm.com
• Highlights:
– free and open source
– strong support for non-linear development
– fully distributed
– efficient handling of large projects
– cryptographic authentication of history
3/13/2015 Version Control with Git 17
19. Getting started with Git
• Standard installations
– http://git-scm.com/downloads
• Available for all the platform
• Git Graphical Applications
– http://git-scm.com/downloads/guis
• For this course, Git is
– included in RailsInstaller
– integrated in RubyMine
3/13/2015 Version Control with Git 19
20. Installing Git
• Windows
– download and install Git from http://git-
scm.com/downloads
• Linux
– check if it is already installed
• open a terminal and type “git”
– otherwise, install it from your package manager or via
http://git-scm.com/downloads
• Mac
– check if it is already installed
• open a terminal and type “git”
– otherwise, install it from http://git-scm.com/downloads
3/13/2015 Version Control with Git 20
21. Git by Example
Marco and Dave work for the same company, but
in two different countries.
They have to realize a new software project, so
they decided to make it in Ruby and to use Git for
version control.
3/13/2015 Version Control with Git 21
SOMEWHERE IN THE USA
MARCO, ITALY DAVE, ENGLAND
22. SOMEWHERE IN THE USA
MARCO, ITALY DAVE, ENGLAND
Git by Example
Marco starts the project by creating a new Git
repository on the central server.
He goes into the project directory and types:
to initialize an empty Git repository for the project.
3/13/2015 Version Control with Git 22
git init --bare myproject.git
23. SOMEWHERE IN THE USA
MARCO, ITALY DAVE, ENGLAND
Git by Example
When the central repository is ready, Dave create
a folder named myproject on his computer and
initializes a repository in it:
3/13/2015 Version Control with Git 23
git init
24. Git by Example
• initializes an empty Git repository inside an
existing folder
• creates a .git directory inside it
• without parameters, typically
– on the server, it is used with the --bare parameter
3/13/2015 Version Control with Git 24
git init
25. SOMEWHERE IN THE USA
MARCO, ITALY DAVE, ENGLAND
Git by Example
Dave writes some code in the myproject folder.
Before committing, Dave needs to really put the
created file under version control, by adding the
file to the Staging area:
3/13/2015 Version Control with Git 25
git add main.rb
26. The Staging Area
• A sort of loading dock
• It can contain things that are neither in the working
copy nor in the repository instance
• Also called “index”
3/13/2015 Version Control with Git 26
STAGING AREA
27. The Staging Area: an example
• Imagine to modify an existing file in the working
copy
• The file is marked as “modified”
3/13/2015 Version Control with Git 27
STAGING AREA
28. The Staging Area: an example
• Before committing, the modified file needs to be
“staged”
– i.e., add a snapshot of it in the staging area
• Modified data has been marked in its current version to
go into the next commit snapshot
3/13/2015 Version Control with Git 28
STAGING AREA
ADD
29. The Staging Area: an example
• Then, changes can be “committed”
– i.e., take the file from the staging area and store
permanently the snapshot in the local repository
3/13/2015 Version Control with Git 29
STAGING AREA
30. SOMEWHERE IN THE USA
MARCO, ITALY DAVE, ENGLAND
Git by Example
If Dave wants permanently to exclude from
version control some files in the project folder, he
can add them in the .gitignore file
– such files and folders will not be staged
3/13/2015 Version Control with Git 30
31. SOMEWHERE IN THE USA
MARCO, ITALY DAVE, ENGLAND
Git by Example
After adding main.rb to the Staging area, Dave
can commit the file to the local repository:
3/13/2015 Version Control with Git 31
git commit -m “initial commit”
32. Git by Example
• store the current snapshot in the local
repository
• -m “put a message here”
– perform the commit with a log message
– useful to know what you have committed
• - a
– a useful parameter
– it performs an add for modified files, too
• useless at this point
3/13/2015 Version Control with Git 32
git commit -m “initial commit”
33. Git by Example
Dave is ready to load the data to the remote
repository. He has to specify what is the remote
server to use:
3/13/2015 Version Control with Git 33
SOMEWHERE IN THE USA
MARCO, ITALY DAVE, ENGLAND
git remote add origin http://centralserver.com/myproject.git
34. Git by Example
• add a new remote repository
– multiple remotes can exists
• for each remote, a name and an address is
specified
– origin is the “standard” name for indicating the
principal remote
– the address can be in the format http(s):// or git://
• remotes can also be removed, renamed, etc.
3/13/2015 Version Control with Git 34
git remote add origin http://centralserver.com/myproject.git
35. Git by Example
Now Dave can push the data to the remote
repository:
where origin is the remote name and master is the
default branch name
3/13/2015 Version Control with Git 35
SOMEWHERE IN THE USA
MARCO, ITALY DAVE, ENGLAND
git push -u origin master
36. Git by Example
• Git pushes only to matching branches
– for every branch that exists on the local side, the remote
side is updated if a branch of the same name already
exists there
• this behavior will change with Git 2.0
– you have to push the branch explicitly the first time
• -u
– set other information useful for other commands (e.g.,
pull)
• After the first time, you can simply use:
– git push
3/13/2015 Version Control with Git 36
git push -u origin master
37. SOMEWHERE IN THE USA
MARCO, ITALY DAVE, ENGLAND
Git by Example
Marco starts working on the project and clones the
remote repository on his computer:
Now Marco has the code!
3/13/2015 Version Control with Git 37
git clone http://centralserver.com/myproject.git
38. Git by Example
• creates a directory named myproject
• initializes a .git directory inside it
• pulls down all the data for that repository
• checks out a working copy of the latest version
If you want to clone the repository into a
directory with another name, you can specify that
as:
3/13/2015 Version Control with Git 38
git clone http://centralserver.com/myproject.git
git clone http://centralserver.com/myproject.git first_project
39. SOMEWHERE IN THE USA
MARCO, ITALY DAVE, ENGLAND
Git by Example
Marco wants to see the details of what Dave did:
The result will be something like:
3/13/2015 Version Control with Git 39
git log
commit bcb39bee268a92a6d2930cc8a27ec3402ebecf0d
Author: Dave <dave@email.co.uk>
Date: Wed Mar 12 10:06:13 2015
initial commit
40. SOMEWHERE IN THE USA
MARCO, ITALY DAVE, ENGLAND
Git by Example
Marco wants to see the details of what Dave did:
The result will be something like:
3/13/2015 Version Control with Git 40
git log
commit bcb39bee268a92a6d2930cc8a27ec3402ebecf0d
Author: Dave <dave@email.co.uk>
Date: Wed Mar 12 10:06:13 2015
initial commit
bcb39bee268a92a6d2930cc8a27ec3402ebecf0d
SHA-1 hash for data integrity
41. Git by Example
• At this point, Marco edits the source code and
saves
• To see the pending changes, he can use:
– git status
• To see the difference between his version and
the previous one, he can use:
– git diff (--cached, to include staged files)
• Marco decides to commit and to push his work
3/13/2015 Version Control with Git 41
git commit -a -m “added new functionalities”
git push
42. SOMEWHERE IN THE USA
MARCO, ITALY DAVE, ENGLAND
Git by Example
Meanwhile, Dave found some bugs in the code.
He looks for update on the central server and get
it (if any):
3/13/2015 Version Control with Git 42
git pull
43. Pull and Fetch in Git
Fetch
– copy changesets from a
remote repository
instance to a local one
– previously, we called it “pull”
Pull
– perform fetch
– update the working copy
3/13/2015 Version Control with Git 43
44. SOMEWHERE IN THE USA
MARCO, ITALY DAVE, ENGLAND
Git by Example
However, no new data is available since Marco
has not yet pushed his changes.
So, Dave fixes the bugs, and commits:
3/13/2015 Version Control with Git 44
git commit -a -m “bug fixing”
45. SOMEWHERE IN THE USA
MARCO, ITALY DAVE, ENGLAND
Git by Example
After some time, Dave tries to push his changes
but something goes wrong
3/13/2015 Version Control with Git 45
git push
To http://centralserver.com/myproject
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to ‘http://centralserver.com/myproject’
46. Git by Example
• What happens?
– Git is not allowing Dave to push his changes because
Marco has already pushed something to the master
branch
• Solution:
– Dave has to do a pull, to bring in changes before
pushing his modifications
• Two possible scenarios:
– merging of files goes smoothly;
– merging of files generates conflicts.
3/13/2015 Version Control with Git 46
47. Git by Example
• Merge with conflicts
• Git includes both Marco’s code and Dave’s code
with conflict markers to delimit things
3/13/2015 Version Control with Git 47
From http://centralserver.com/myproject
b19f36c..b77378f master -> origin/master
Auto-merging main.rb
CONFLICT (content): Merge conflict in main.rb
Automatic merge failed; fix conflicts and then commit the result.
<<<<<<< HEAD
# Marco’s code here
=======
# Dave’s code here
>>>>>>> b77378f6eb0af44468be36a085c3fe06a80e0322
48. SOMEWHERE IN THE USA
MARCO, ITALY DAVE, ENGLAND
Git by Example
After (manually) resolving these conflicts, Dave is
able to push the changes:
3/13/2015 Version Control with Git 48
git push
49. Other Useful Commands
• Operations on files
– Remove: git rm [filename]
– Move/rename: git mv [file-from] [file-to]
– Unstage some staged files: git reset HEAD [filename-
list]
– Unmodify a modified file: git checkout -- [filename]
• Change the last commit
– git commit --amend
3/13/2015 Version Control with Git 49
50. Other Useful Commands
• Operations on remotes
– List: git remote (-v, to show the URLs)
– Add: git remote add [shortname] [url]
– Inspect: git remote show [remote-name]
– Rename: git remote rename [old-name] [new-name]
– Remove: git remote rm [remote-name]
3/13/2015 Version Control with Git 50
51. Tags and Branches in a Nutshell
• Local and remote
• Do not push automatically
[Image from http://nvie.com/posts/a-successful-git-branching-model/]
3/13/2015 Version Control with Git 51
52. Tags… in brief
• useful to mark release points
• two types:
– lightweight
– annotated (more complete)
• commands:
– git tag, shows the available existing tags
– git tag [tag-name], creates a lightweight tag
– git tag -a [tag-name] -m [message]‚ creates an
annotated tag
– tag show [tag-name], shows the tag data
3/13/2015 Version Control with Git 52
53. Branches… in brief
• used to develop features isolated from each other
• the master branch is the “default” branch when you
create a repository
– you should use other branches for development and
merge them back to the master branch upon completion
• really lightweight in Git
• commands:
– git branch [branch-name], create a new branch
– git branch, lists all existing branches
– git checkout [branch-name], switches to the selected
branch
– git branch -d [branch-name], removes the selected branch
3/13/2015 Version Control with Git 53
54. Hosted Git
• To have (at least) one remote repository
– alternative: set up your own Git server!
• Most popular:
– GitHub, https://github.com/
– Bitbucket, https://bitbucket.org/
– Sourceforge, http://sourceforge.net/
– CodePlex (by Microsoft), https://www.codeplex.com/
3/13/2015 Version Control with Git 54
55. GitHub
• Slightly different than other code-hosting sites
– instead of being primarily based on the project, it is
user-centric
– social coding
• A commercial company
– charges for accounts that maintain private repository
– free account to host as many open source project as
you want
– free Micro plan for students
• 5 private repositories, unlimited public repositories
• https://education.github.com
3/13/2015 Version Control with Git 55
56. Bitbucket
• Similar to GitHub
• Less used than GitHub, right now
• Mercurial support
• A commercial company
– free private and public repositories for small team
(up to 5 private collaborators)
– charges for project involving bigger team
– free for academia (also for students)
• unlimited public and private repositories
• unlimited users for single projects
3/13/2015 Version Control with Git 56
57. GitHub Pages
• Website for your (GitHub) repository
– https://pages.github.com/
• We will use it for hosting your project
documentation
– everything realized in Modulo B
– your website will be reachable from
http://lam-2015.github.io/your-project-name
• FAQ
– https://help.github.com/categories/github-pages-
basics/
3/13/2015 Version Control with Git 57
58. Homework(s)
• Create a personal GitHub account
– you can also ask for a “student discount” at
https://education.github.com
– we will require your username to set up your team
repositories for final projects
• Try Git!
– http://try.github.io/
– 15 minutes tutorial
3/13/2015 Version Control with Git 58
59. References
• Git Reference
– http://gitref.org/
• Git - the simple guide
– http://rogerdudler.github.io/git-guide/
• Git Documentation
– http://git-scm.com/docs
• Pro Git (online book)
– http://git-scm.com/book
• Version Control by Example (online book)
– http://www.ericsink.com/vcbe/
3/13/2015 Version Control with Git 59
60. References
• Try Git!
– http://try.github.io/
• Various Git resources
– https://help.github.com/articles/what-are-other-good-
resources-for-learning-git-and-github
• A successful Git branching model
– http://nvie.com/posts/a-successful-git-branching-model/
• Some Git (graphical) clients
– http://git-scm.com/downloads/guis
• EGit, Eclipse plugin for Git
– http://www.eclipse.org/egit/
3/13/2015 Version Control with Git 60
62. License
• This work is licensed under the Creative Commons “Attribution-
NonCommercial-ShareAlike Unported (CC BY-NC-SA 3,0)” License.
• You are free:
– to Share - to copy, distribute and transmit the work
– to Remix - to adapt the work
• Under the following conditions:
– Attribution - You must attribute the work in the manner specified by the
author or licensor (but not in any way that suggests that they endorse you
or your use of the work).
– Noncommercial - You may not use this work for commercial purposes.
– Share Alike - If you alter, transform, or build upon this work, you may
distribute the resulting work only under the same or similar license to this
one.
• To view a copy of this license, visit
http://creativecommons.org/license/by-nc-sa/3.0/
3/13/2015 Version Control with Git 62