Going from freelance to working in an agency can be overwhelming, but don’t let the fear of a collaborative workflow scare you.
What is Git?? Better question, what is version control? And what the heck is a local environment?
We’ll cover the basics of
– Local environments, multidevs, and branches
– Version control
– Overview of a git client
5. What we’ll
discuss today
▸ Freelance versus Agency life
▸ Version control
・ Git
・ Git branches
・ Git commands
▸ Git clients
▸ Local environments
▸ Demos if time permits
Git into the Groove | 5
13. Workflow Management
Submit a
Ticket
Backup code,
database and files
Feature branches
Set up local environment
Push up to
Development
Approval &
push to
production
QA &
Testing
Sync code and
clone
Staging
Git into the Groove | 13
15. According to Atlassian
Version control software keeps track of
every modification to the code in a special
kind of database.
Git into the Groove | 15
27. If you haven't connected your local
repository to a remote server, add
the server to be able to push to it.
git pull
git remote
Fetch and merge changes on the
remote server to your working
directory.
git clone
Create a working copy of a local
repository.
Working Locally
Git into the Groove | 27
30. Branches
List all the branches in
your repo.
git branch
Delete the feature branch.
git checkout -d
Create a new branch and
switch to it.
git checkout -b
Switch from one branch to
another.
git checkout
Git into the Groove | 30
33. Pushing
Add one or more files to
staging.
git add *
git add <file name>
git add
Send changes to the main
branch of your remote
repository.
git push
Fetch and merge changes
on the remote server to
your working directory.
git pull
Commit changes to
current branch.
git commit -m “message
here”
git commit -a
git commit
Git into the Groove | 33
35. Pausing for a moment to
hold space for
#BlackTransLivesMatter
36. Requesting for the very first
time….
Like a Merge-In
Git into the Groove | 36
37. Fetch and merge changes on the
remote server to your working
directory.
git merge
git pull
To merge a different branch into
your active branch
git remote
This command is used to connect
your local repository to the remote
server.
Bringing it all Together
Git into the Groove | 37
40. 40
If you’ve got the notion…
Conflicts N
Commotion
Git into the Groove | 40
41.
42. Merge Conflicts
List the files you've
changed and those you
still need to add or
commit.
git status
Send changes to the main
branch of your remote
repository.
git push
View all the m.erge
conflicts
git log - -merge
Show changes between
commits, commit and
working tree, etc
git diff
Git into the Groove | 42
44. This command undoes all the
commits after the specific commit
and preserves the changes.
git reset - -hard <commit>
git reset <commit>
This command discards all history
and goes back to the specific
commit.
git fetch origin
Fetches the latest history from the
server.
Really mess up?
Git into the Groove | 44
45. Reset of all the
things!
Git into the Groove | 45
47. The Workflow
▸ Create a branch
・ Work in a space away from production
▸ Work locally
・ Work from anywhere
▸ Add commits
・ Modify the code and add the changes
▸ Create a pull request
・ This starts the process of review
▸ Code review
・ Discuss and collaborate
▸ Merge
・ Move your code into the main branch
Git into the Groove | 47
54. Local Server
Setups
▸ Linux development environments
▸ Mac OS development environment
▸ Windows development environment
▸ Virtual Machine development
environments
▸ Docker development environments
Git into the Groove | 54
56. Limited Access
to Client Server
If you’re building a website and you
don’t have access to the web
server.
Git into the Groove | 56
57. Experimentation
You don’t want to mess with the
production code while experimenting
with new code.
Git into the Groove | 57
58. Test your development before
going live.
Makes the development less
stressful.
More control!
Customize your
setup
Debugging complex errors requires
more control over your
environment.
No internet
connection required!
No longer bound to the internet.
Work from anywhere!
Local Environments
Git into the Groove | 58
59. Local web
development
environment
Usually come equipped with:
▸ A web server
▸ A database management system
▸ A server-side programming language
▸ An interface for controlling the web server
▸ An interface for accessing the database
Git into the Groove | 59
62. ▸ Bitbucket Support
▸ Top 20 Git Commands With Examples
▸ Oh Shit, Git!?!
▸ Git Documentation
Resources - Git
Git into the Groove | 62
63. PANTHEON.IO
I’m a Pantheon Hero
I advocate for the growth, education,
and advancement of the Open Web
and Pantheon
Learn more about what it takes to be a
Hero below:
https://community.pantheon.io