Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
git-presentation.pdf
1. Git & GitHub Workshop
Milind Mishra, Software Engineer
Open Source Contribution is all about Git, GitHub & You!
2. I’m Milind, I build better Web Experiences ✨
More about me.
• UX/UI Design Intern at iNeuron.ai
• Frontend & DevOps Engineer at Locus Connect
• Research Intern at NYCU Taiwan
• Software Engineer at Startup Hire
• My Portfolio : https://milindmishra.com
5. • Keeps track of changes to code
Create file Add a line
6. • Keeps track of changes to code
Create file Add a line Delete a line
7. • Synchronises code between different people
👩💻 👨💻
Git server
(lets say git repository)
8. • Synchronises code between different people
👩💻 👨💻
Git server
(lets say git repository)
Clone repository to
local machines
9. • Synchronises code between different people
👩💻 👨💻
Git server
(lets say git repository)
Make individual changes
10. • Synchronises code between different people
👩💻 👨💻
Git server
(lets say git repository)
Push changes to the server
Merge changes,
resolve conflicts …
11. • Synchronises code between different people
👩💻 👨💻
Git server
(lets say git repository)
Pull changes
15. Create file Add a line Delete a line
• Reverting back to old versions of code.
16. Create file Add a line
• Reverting back to old versions of code.
17. What is Git ?
• Keeps track of changes to code.
• Synchronises code between different people.
• Test changes to code without losing the original.
• Revert back to old versions of code.
19. • Makes a copy of a repository
• Stores it on your computer
• A “fork” creates your own copy of
someone else’s repository.
git clone <url>
👨💻
git clone <url>
20. • Makes a copy of a repository
• Stores it on your computer
• A “fork” creates your own copy of
someone else’s repository.
git clone <url>
👨💻
22. • Adds a
f
ile to “staging area”
• Tells git to include the
f
ile in the
next revision to the repository.
• To add all changed
f
iles
git add <filename>
👨💻
git add *
23. • Adds a
f
ile to “staging area”
• Tells git to include the
f
ile in the
next revision to the repository.
• To add all changed
f
iles
git add <filename>
👨💻
git add *
Changes to be committed:
modified: numbers.c
27. • Saves the changes to repository
as a new version (a “commit”)
• Records a message
• To add all changed
f
iles and
commit in the same step
git commit -m ”message”
👨💻
git commit -am “message”
28. • Saves the changes to repository
as a new version (a “commit”)
• Records a message
• To add all changed
f
iles and
commit in the same step
git commit -m ”message”
👨💻
git commit -am “message”
Add line
31. • Shows current status of the
repository
git status
👨💻
$ git status
Add line
32. • Shows current status of the
repository
git status
👨💻
$ git status
Add line
On branch master
Your branch is ahead of ‘origin/master’ by 1 commit.
(Use “git push” to publish your local commits)
45. • When two different commits can’t
be automatically merged
• Need to be resolved
Merge Con
f
licts
👨💻
46. • When two different commits can’t
be automatically merged
• Need to be resolved
Merge Con
f
licts
👨💻
git pull
Conflict (content): Merge conflict in numbers.c
Automatic merge failed; fix conflicts and then
commit the result.
47. • When two different commits can’t
be automatically merged
• Need to be resolved
Merge Con
f
licts
👨💻
git pull
{
{
Your changes
Remote changes
Con
f
licting commit
48. • When two different commits can’t
be automatically merged
• Need to be resolved
Merge Con
f
licts
👨💻
git pull
49. • When two different commits can’t
be automatically merged
• Need to be resolved
Merge Con
f
licts
👨💻
git pull
54. • To revert back to a previous
commit
• To revert code back to remote
repository version
git reset
👨💻
git reset —hard <commit>
git reset —hard origin/master
55. • To revert back to a previous
commit
• To revert code back to remote
repository version
git reset
👨💻
git reset —hard <commit>
git reset —hard origin/master
Add line
2346546
Remove line
8976324
Commit hash from “git log”
59. • Shows all branches of code
• Create a branch with
• Switch to (“checkout”) a new
branch with
• Both create and switch to a new
branch by
git branch
git branch <branch_name>
git checkout <branch_name>
git switch <branch_name>
git checkout -b <branch_name>
60. • Shows all branches of code
• Create a branch with
• Switch to (“checkout”) a new
branch with
• Both create and switch to a new
branch by
git branch
git branch <branch_name>
git checkout <branch_name>
git switch <branch_name>
git checkout -b <branch_name>
👨💻
master
test
67. What is Git ?
• Keeps track of changes to code.
• Synchronises code between different people.
• Test changes to code without losing the original.
• Revert back to old versions of code.