Git, the widely popular version control tool that just about everyone who works on the web seems to use, is powerful, scalable, flexible. . .and difficult to learn. If you’ve used Git for any amount of time, you’ve probably gotten yourself into some confusing, frustrating, or downright terrifying situations. But don’t panic. You are not alone. Katie Sylor-Miller explains how to avoid getting into Git messes in the first place, demonstrating how the fundamental structures in Git actually work under the hood and sharing best practices, workflows, and tools that will keep your commits in order and reduce the panic caused by merge conflicts. Katie then shows you how to leverage Git’s powerful features to save yourself when everything seems to go wrong.
Git is a distributed version control system, created by Linus Torvalds, and used worldwide by many software developers for a large number of well known software projects.
In this presentation, I explain the fundamentals of the Git software and some of its internal workings and related terminology. The target audience is individuals who have used Git before in a limited capacity and want expand their knowledge of the software to improve their daily use of it. The presentation could also be useful for those with knowledge of Git and a desire to improve their understanding of some of the more technically elements.
Git is a distributed version control system, created by Linus Torvalds, and used worldwide by many software developers for a large number of well known software projects.
In this presentation, I explain the fundamentals of the Git software and some of its internal workings and related terminology. The target audience is individuals who have used Git before in a limited capacity and want expand their knowledge of the software to improve their daily use of it. The presentation could also be useful for those with knowledge of Git and a desire to improve their understanding of some of the more technically elements.
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.
This presentation covers how to modify git history to fix mistakes and provide a clearer picture of the flow of changes. I walk through some basic git fundamentals, and then outline several different methods of modifying history, as well as what type of situation they would apply for.
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.
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.
GIT: Content-addressable filesystem and Version Control SystemTommaso Visconti
Git presentation, internals, advanced use and workflow examples.
Presentation by Tommaso Visconti http://www.tommyblue.it for DrWolf srl http://www.drwolf.it
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.
This presentation covers how to modify git history to fix mistakes and provide a clearer picture of the flow of changes. I walk through some basic git fundamentals, and then outline several different methods of modifying history, as well as what type of situation they would apply for.
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.
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.
GIT: Content-addressable filesystem and Version Control SystemTommaso Visconti
Git presentation, internals, advanced use and workflow examples.
Presentation by Tommaso Visconti http://www.tommyblue.it for DrWolf srl http://www.drwolf.it
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
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017Codemotion
In the years spent on the front line managing open source projects and applications developed by distributed teams, I've managed to gather quite a few Git stories from the trenches. In this practically oriented talk, I will share some patterns and practices I have collected while on the front. We will first go through some useful git aliases, then touch on topics such as the various git branching models, long-running branches, conflict management, the rewriting of project history, etcetera. Oh and yes, the (in)famous Git rebase will be covered too.
Kazdy developer zna Gita lub przynajmniej slyszal o nim. Oferuje on wiele mozliwosci, które pozwalaja na tworzenie pelnej historii kodu w projekcie. Aby jednak historia byla przyjazna i przejrzysta, dobrze jest stosowac kilka zasad podczas korzystania z Gita. W czasie prezentacji przedstawie te zasady i omówie kilka sposobów na efektywne wykorzystanie tego systemu kontroli wersji do trzymania historii "w ryzach".
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 :)
Similar to Git-ing out of your git messes - Fluent Conf 2017 (20)
Happy Browser, Happy User! NY Web Performance Meetup 9/20/19Katie Sylor-Miller
xPerformance is fundamentally, a UX concern. Sites that are slow to render or janky to interact with are a bad user experience. We strive to write performant code for our users, but users don’t directly interact with our code - it all happens through the medium of the browser.
The browser is the middleman between us and our users; therefore to make our users happy, we first have to make the browser happy. But how exactly do we do that?
In this talk, we’ll learn how browsers work under the hood: how they request, construct, and render a website. At each step along the way, we’ll cover what we can do as developers to make the browser’s job easier, and why those best practices work. You’ll leave with a solid understanding of how to write code that works *with* the browser, not against it, and ultimately improves your users’ experience.
Performance is fundamentally, a UX concern. Sites that are slow to render or janky to interact with are a bad user experience. We strive to write performant code for our users, but users don’t directly interact with our code - it all happens through the medium of the browser. The browser is the middleman between us and our users; therefore to make our users happy, we first have to make the browser happy. But how exactly do we do that?
In this talk, we’ll learn how browsers work under the hood: how they request, construct, and render a website. At each step along the way, we’ll cover what we can do as developers to make the browser’s job easier, and why those best practices work. You’ll leave with a solid understanding of how to write code that works with the browser, not against it, and ultimately improves your users’ experience.
Performance is fundamentally, a UX concern. Sites that are slow to render or janky to interact with are a bad user experience. We strive to write performant code for our users, but users don’t directly interact with our code - it all happens through the medium of the browser. The browser is the middleman between us and our users; therefore to make our users happy, we first have to make the browser happy. But how exactly do we do that?
In this talk, we’ll learn how browsers work under the hood: how they request, construct, and render a website. At each step along the way, we’ll cover what we can do as developers to make the browser’s job easier, and why those best practices work. You’ll leave with a solid understanding of how to write code that works *with* the browser, not against it, and ultimately improves your users’ experience.
Design Systems are most successful when they have a solid process in place to manage, maintain, and share component code across multiple teams and codebases. The best way to achieve this is to manage code using a version control system like Git. Git is the defacto industry standard tool for storing and editing code for a reason - it's powerful, scalable, flexible... but can be confusing or intimidating, whether you're a newbie or you use it every day!
In this workshop, Katie Sylor-Miller, the creator of OhShitGit.com, and co-author of The Design Systems Handbook, will teach you all you need to know to use Git as a tool for managing your Design System code.
We'll walk through everything you need to know to create, contribute to, maintain, and share your design system code as a standalone repo in Git. We'll go over how the fundamental structures in Git and how it all works under the hood. We'll create our own repos and get comfortable running common git commands in the terminal. We'll learn about best practices, workflows, and tools that will keep your commits in order and reduce the panic caused by merge conflicts. And, we'll cover some cool features in the Github UI to help you document, manage, and share your Design System code.
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...Katie Sylor-Miller
Raiders of the Fast Start: Frontend Performance Archeology
There are a lot of books, articles, and online tutorials out there with fantastic advice on how to make your websites performant. It all seems easy in theory, but applying best practices to real-world code is anything but straightforward. Diagnosing and fixing frontend performance issues on a large legacy codebase is like being an archaeologist excavating the remains of a lost civilization. You don’t know what you will find until you start digging!
Pick up your trowels and come along with Etsy’s Frontend Systems team as we become archaeologists digging into frontend performance on our large, legacy mobile codebase. I’ll share real-life lessons you can use to guide your own excavations into legacy code:
What tools and metrics we used to diagnose issues and track progress.
How we went beyond server-driven best practices to focus on the client.
Which fixes successfully increased conversion, and which didn’t.
Our work, like all good archaeology, went beyond artifacts and unearthed new insights into our culture. We at Etsy pride ourselves on our culture of performance, but, like all cultures, it needs to adapt and reinvent itself to account for changes to the landscape. Based on what we’ve learned, we are making the case for a new, organization-wide, frontend-focused performance culture that will solve the problems we face today.
Raiders of the Fast Start: Frontend Performance Achaeology - Fluent 2018Katie Sylor-Miller
There are a lot of books, articles, and online tutorials out there with fantastic advice on how to make your websites performant. It all seems so easy in theory, but applying best practices to real-world code is anything but straightforward. Diagnosing and fixing frontend performance issues on a large legacy codebase is like being an archaeologist excavating the remains of a lost civilization. You don’t know what you will find until you start digging.
Pick up your trowels and join Katie Sylor-Miller to dig into frontend performance on Etsy’s large legacy mobile codebase, exploring real-life lessons you can use to guide your own excavations into legacy code and discovering how Etsy unearthed new insights into its culture. While Etsy prides itself on its culture of performance, like all cultures, it needs to adapt and reinvent itself to account for changes to the landscape. The company is now making the case for a new, organization-wide frontend-focused performance culture that will solve the problems we face today.
Topics include:
The open source tools and metrics Etsy used to diagnose issues and track progress
How Etsy went beyond server-driven best practices to focus on the client
The tools Etsy built to help find and delete old, unused code
Which fixes successfully increased conversion and which didn’t
We developers and designers are obsessed with getting our images “just right” before we display them to our users. We perfect their art direction, selecting images that set the right mood or convey the right information. We fine-tune their performance characteristics and ensure that we serve the right image for a multitude of devices. But what about users who can’t see our finely-tuned images or distinguish between the colors in our beautiful infographics? How do we ensure that our images are accessible so that everyone can experience your site to the fullest ?
In this session, we’ll learn about the different types of visual, auditory, cognitive, and motor impairments that affect how users interact with images and other media, and we’ll cover practical techniques for ensuring that your images are accessible to everyone, regardless of how they experience the web.
Raiders of the Fast Start: Frontend Performance Archaeology PerfmattersConf 2018Katie Sylor-Miller
There are a lot of books, articles, and online tutorials out there with fantastic advice on how to make your websites performant. It all seems easy in theory, but applying best practices to real-world code is anything but straightforward. Diagnosing and fixing frontend performance issues on a large legacy codebase is like being an archaeologist excavating the remains of a lost civilization. You don’t know what you will find until you start digging!
Pick up your trowels and come along with Etsy’s Frontend Systems team as we become archaeologists digging into frontend performance on our large, legacy mobile codebase. I’ll share real-life lessons you can use to guide your own excavations into legacy code:
What tools and metrics we used to diagnose issues and track progress.
How we went beyond server-driven best practices to focus on the client.
Which fixes successfully increased conversion, and which didn’t.
Our work, like all good archaeology, went beyond artifacts and unearthed new insights into our culture. We at Etsy pride ourselves on our culture of performance, but, like all cultures, it needs to adapt and reinvent itself to account for changes to the landscape. Based on what we’ve learned, we are making the case for a new, organization-wide, frontend-focused performance culture that will solve the problems we face today.
Presentation from https://perfmattersconf.com/
From FrontendConf Zurich 2016
As the web development landscape rapidly changes, good communication and collaboration between multiple job functions is key to not just a project’s success, but to a successful career as a front end developer. In this talk, we’ll discuss why it is important to grow yourself into a “T-shaped” developer - someone with deep knowledge in front end development, who can collaborate across multiple other disciplines. You'll leave knowing how to incorporate essential empathy and communication skills into your daily work life, leveling up your career, and the career of those around you.
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
Hierarchical Digital Twin of a Naval Power SystemKerry Sado
A hierarchical digital twin of a Naval DC power system has been developed and experimentally verified. Similar to other state-of-the-art digital twins, this technology creates a digital replica of the physical system executed in real-time or faster, which can modify hardware controls. However, its advantage stems from distributing computational efforts by utilizing a hierarchical structure composed of lower-level digital twin blocks and a higher-level system digital twin. Each digital twin block is associated with a physical subsystem of the hardware and communicates with a singular system digital twin, which creates a system-level response. By extracting information from each level of the hierarchy, power system controls of the hardware were reconfigured autonomously. This hierarchical digital twin development offers several advantages over other digital twins, particularly in the field of naval power systems. The hierarchical structure allows for greater computational efficiency and scalability while the ability to autonomously reconfigure hardware controls offers increased flexibility and responsiveness. The hierarchical decomposition and models utilized were well aligned with the physical twin, as indicated by the maximum deviations between the developed digital twin hierarchy and the hardware.
Forklift Classes Overview by Intella PartsIntella Parts
Discover the different forklift classes and their specific applications. Learn how to choose the right forklift for your needs to ensure safety, efficiency, and compliance in your operations.
For more technical information, visit our website https://intellaparts.com
Welcome to WIPAC Monthly the magazine brought to you by the LinkedIn Group Water Industry Process Automation & Control.
In this month's edition, along with this month's industry news to celebrate the 13 years since the group was created we have articles including
A case study of the used of Advanced Process Control at the Wastewater Treatment works at Lleida in Spain
A look back on an article on smart wastewater networks in order to see how the industry has measured up in the interim around the adoption of Digital Transformation in the Water Industry.
Student information management system project report ii.pdfKamal Acharya
Our project explains about the student management. This project mainly explains the various actions related to student details. This project shows some ease in adding, editing and deleting the student details. It also provides a less time consuming process for viewing, adding, editing and deleting the marks of the students.
Literature Review Basics and Understanding Reference Management.pptxDr Ramhari Poudyal
Three-day training on academic research focuses on analytical tools at United Technical College, supported by the University Grant Commission, Nepal. 24-26 May 2024
Water billing management system project report.pdfKamal Acharya
Our project entitled “Water Billing Management System” aims is to generate Water bill with all the charges and penalty. Manual system that is employed is extremely laborious and quite inadequate. It only makes the process more difficult and hard.
The aim of our project is to develop a system that is meant to partially computerize the work performed in the Water Board like generating monthly Water bill, record of consuming unit of water, store record of the customer and previous unpaid record.
We used HTML/PHP as front end and MYSQL as back end for developing our project. HTML is primarily a visual design environment. We can create a android application by designing the form and that make up the user interface. Adding android application code to the form and the objects such as buttons and text boxes on them and adding any required support code in additional modular.
MySQL is free open source database that facilitates the effective management of the databases by connecting them to the software. It is a stable ,reliable and the powerful solution with the advanced features and advantages which are as follows: Data Security.MySQL is free open source database that facilitates the effective management of the databases by connecting them to the software.
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesChristina Lin
Traditionally, dealing with real-time data pipelines has involved significant overhead, even for straightforward tasks like data transformation or masking. However, in this talk, we’ll venture into the dynamic realm of WebAssembly (WASM) and discover how it can revolutionize the creation of stateless streaming pipelines within a Kafka (Redpanda) broker. These pipelines are adept at managing low-latency, high-data-volume scenarios.
Final project report on grocery store management system..pdfKamal Acharya
In today’s fast-changing business environment, it’s extremely important to be able to respond to client needs in the most effective and timely manner. If your customers wish to see your business online and have instant access to your products or services.
Online Grocery Store is an e-commerce website, which retails various grocery products. This project allows viewing various products available enables registered users to purchase desired products instantly using Paytm, UPI payment processor (Instant Pay) and also can place order by using Cash on Delivery (Pay Later) option. This project provides an easy access to Administrators and Managers to view orders placed using Pay Later and Instant Pay options.
In order to develop an e-commerce website, a number of Technologies must be studied and understood. These include multi-tiered architecture, server and client-side scripting techniques, implementation technologies, programming language (such as PHP, HTML, CSS, JavaScript) and MySQL relational databases. This is a project with the objective to develop a basic website where a consumer is provided with a shopping cart website and also to know about the technologies used to develop such a website.
This document will discuss each of the underlying technologies to create and implement an e- commerce website.
9. What’s in a commit
Each commit contains a few pieces of information:
• A snapshot of the entire repo
• Who made this change
• When this change was made
• A message describing the commit
• A pointer to the previous commit
10. What’s in a commit
SHA-1
Unique
40-char
hash
Each commit contains a few pieces of information:
• A snapshot of the entire repo
• Who made this change
• When this change was made
• A message describing the commit
• A pointer to the previous commit
15. Mental model: branches are a linked list
a4df41aaec56116dab6a71a35312 912bde5
• A snapshot of the entire repo
• Who made this change
• When this change was made
• A message describing the commit
• A pointer to the previous commit
A B C D E
16. Mental model: branches are a linked list
a4df41aaec56116dab6a71a35312 912bde5
• A snapshot of the entire repo
• Who made this change
• When this change was made
• A message describing the commit
• A pointer to the previous commit
A B C D E
17. Branches are a linked list reference
A4DF41A6DAB6A7
a4df41aaec56116dab6a71a35312 912bde5
A B C D EA B C D E
master
18. Branches are a linked list reference text file
A4DF41A6DAB6A7
a4df41aaec56116dab6a71a35312 912bde5
master
.git/refs/heads/master
912bde5d4e5e962269ddff87da83cc5ce55e75d0
A B C D E
20. New branches are a new reference
A4DF41A6DAB6A7
a4df41aaec56116dab6a71a35312 912bde5
master
new-branch
A B C D E
21. New branches are a new text file
A4DF41A
a4df41aaec56116dab6a71a35312 912bde5
master
A B C D E
.git/refs/heads/master
912bde5d4e5e962269ddff87da83cc5ce55e75d0
.git/refs/heads/new-branch
912bde5d4e5e962269ddff87da83cc5ce55e75d0
new-branch
23. HEAD points to your currently checked-out branch
HEAD
a4df41aaec56116dab6a7 912bde5
master
new-branch
B C D E
24. HEAD is a reference to a reference
HEAD
A4DF41A6DAB6A7
a4df41aaec56116dab6a7 912bde5
master
new-branch
.git/refs/HEAD
ref: refs/heads/master
B C D E
25. WTF is the HEAD
• The HEAD decides what branch/commit will be the target of
your actions
• There is only one HEAD per repository
• The HEAD is unique to your local install of git
• The history of the HEAD is recorded, which gives you a way
to undo your work (more on this later)
27. HEAD points to your currently checked-out branch
HEAD
a4df41aaec56116dab6a7 912bde5
master
new-branch
.git/refs/HEAD
ref: refs/heads/master
B C D E
44. ksylormiller:~/ohshitgit (master)$ 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 checkout -- <file>..." to discard changes in working directory)
modified: bar.php
no changes added to commit (use "git add" and/or "git commit -a”)
44
git status is your BFF
60. Merge remote-tracking branch 'origin/master'
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
~
~
~
~
"~/ohshitgit/.git/MERGE_MSG" 7L, 293C
60
oh god we’re in vim
69. ksylormiller:~/ohshitgit (master)$ git rebase origin/master
First, rewinding head to replay your work on top of it...
Applying: Meaningful commit message
69
git rebase
72. ksylormiller:~/ohshitgit (master)$ git pull --rebase
First, rewinding head to replay your work on top of it...
Applying: Meaningful commit message
72
git pull --rebase == git fetch && git rebase
79. View the history of a branch
1668d2f
HEAD
a4df41aaec56116dab6a7 912bde5
master
B C D E F
80. ksylormiller:~/ohshitgit (master)$ git log
commit 3c2335c50a1ad48a283a475e3d3f9ac445a20ff5
Author: Katie Sylor-Miller <katie@ohshitgit.com>
Date: Thu Jun 8 23:42:05 2017 -0400
Another awesome commit
A detailed message about this commit goes here
commit f6e51fdd6650c7bbc39895c0392ec6a9fb5a9c15
Author: Someone else <someone@ohshitgit.com>
Date: Thu Jun 8 23:39:36 2017 -0400
Oh hai this is a change
commit 4f9a80ff7732f252ffbe7841e96748707da1a78d
80
git log
81. by Etsy seller Birdwoodshack
git reflog
is your magic
time machine
82. ksylormiller:~/ohshitgit (master)$ git reflog
3c2335c HEAD@{0}: rebase finished: returning to refs/heads/master
3c2335c HEAD@{1}: pull --rebase: lolz
f6e51fd HEAD@{2}: pull --rebase: checkout f6e51fdd6650c7bbc39895c0392ec6a9fb5a9c15
f4f4d99 HEAD@{3}: reset: moving to HEAD@{4}
f6e51fd HEAD@{4}: reset: moving to HEAD~
1ecad3a HEAD@{5}: rebase finished: returning to refs/heads/master
1ecad3a HEAD@{6}: rebase: lolz
f6e51fd HEAD@{7}: rebase: checkout origin/master
f4f4d99 HEAD@{8}: commit: lolz
4f9a80f HEAD@{9}: commit: Another awesome commit
4875652 HEAD@{10}: commit: Meaningful commit message
82
git reflog
83. HEAD notation
• HEAD@{index} : go to a specific point
• HEAD~ == HEAD@{currentindex+1} : back one action
• HEAD~x == HEAD@{currentindex+x} : back x actions
• Or, you can always reference by hash
84. ksylormiller:~/ohshitgit (master)$ git show HEAD@{8}
commit f4f4d996d44bbf824cdd22ace9e6d154d27c9a5d
Author: Katie Sylor-Miller <katie@ohshitgit.com>
Date: Thu Jun 8 23:42:05 2017 -0400
lolz
diff --git a/bar.php b/bar.php
index f81fce0..bdd3cb3 100644
--- a/bar.php
+++ b/bar.php
@@ -1 +1,4 @@
this is a file
-with nothing
+with some lolz
84
git show
85. ksylormiller:~/ohshitgit (master)$ git checkout HEAD@{8}
Note: checking out 'HEAD@{8}'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
HEAD is now at a4df41a... Merge remote-tracking branch 'origin/master'
ksylormiller:~/ohshitgit (master) ((detached from a4df41a))$
85
git checkout
86. A detached HEAD is when your
HEAD points directly to a
commit or a tracking branch
(not an editable branch)
WTF is a detached HEAD?
93. Three basic types of resetting
Discards the changes
from the affected
commits
Leaves the changes
from the affected
commits in the
workspace (default)
--hard--mixed--soft
Leaves the changes
from the affected
commits in staging
98. Revert "lolz"
This reverts commit f4f4d996d44bbf824cdd22ace9e6d154d27c9a5d.
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Your branch is ahead of 'origin/master' by 3 commits.
# (use "git push" to publish your local commits)
#
# Changes to be committed:
# modified: bar.php
#
~
"~/ohshitgit/.git/COMMIT_EDITMSG" 14L, 450C
98
ugh, vim again
103. Lots of commits are better
• Commits are cheap and easy
• Save your progress over time
• Easier to backtrack if you screw up
• Less chance of committing the wrong thing when you are
reviewing small changes
105. • Set up your command line to show you what branch you are on
• Use .gitignore to your advantage
• Remember git status is your BFF
• Understand how staging works (subsequent changes to a file
are not reflected)
Avoid the problem: Committing the wrong thing
110. • Safety net: you aren’t changing master directly until your
feature is ready for prime time
• Allows you to switch between tasks/manage unrelated
changes
• Share larger features or long-term work with your team and
preserve its history
• Caution: Don’t use long-lived feature branches
Why a feature branch workflow is better
112. MERGE
Adds a new commit to
your feature branch.
You are resolving
potential conflicts created
by other people’s code.
Replays your commits on
top of the latest of master.
You are resolving
potential conflicts created
by your own code.
REBASE
Merge vs. rebase
116. pick 2f5bae4 example feature branch
pick 0ee2a20 Another commit
# Rebase aaff258..0ee2a20 onto aaff258
#
# 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
~
"~/ohshitgit/.git/rebase-merge/git-rebase-todo" 20L, 670C
116
Interactive rebase
117. pick 2f5bae4 example feature branch
fixup 0ee2a20 Another commit
# Rebase aaff258..0ee2a20 onto aaff258
#
# 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
~
"~/ohshitgit/.git/rebase-merge/git-rebase-todo" 20L, 670C
117
Interactive rebase
118. ksylormiller:~/ohshitgit (feature-branch)$ git rebase -i HEAD~2
[detached HEAD a682e3a] example feature branch
3 files changed, 5 insertions(+)
Successfully rebased and updated refs/heads/feature-branch.
118
Avoid rebasing problems: combine commits
124. • Update your local master and origin/master all.the.time.
• Rebase your feature branches to stay up to date
• Periodically squash feature branch commits to reduce the
number of conflicts to resolve (esp. when rebasing)
• Communication with teammates
• If things don’t seem right, abort!
Avoid the problem: Merge conflicts
128. • Understand the fundamentals (commits, branches, HEAD,
history, workflows)
• Know how to view & fix history (reflog is git’s magic time
machine)
• Always be committing
• Always be branching (but stay up to date)
• DON’T PANIC, everything is fixable
Avoid git messes in the first place