15. Existing project
• cd into/project/folder
• git init
• This will create a git repository for your project
• At this point, files are not being tracked.
16. Clone a repo
• cd into/desired/folder
• git clone <url>
• The url here will will default to the origin of the
remote.
• Clean repo, all files that have been added are
being tracked.
23. • git status; check the status of the working
directory
• git add <options> <filename>; track/stage files
to be committed.
• git commit; Commit a git snapshot into a
repository.
24. Before we get ahead of
ourselves… most of the time, it’s a
good idea to initialize a .gitignore
25. .gitignore
• Control which files will be ignored when staging
• Add files that you want to ignore to this list
• *.x <— Ignores all files ending in .x
• For directories, end in ‘/’
• Basic bash patterns can be used.
27. Branches
• git branch <name>; create a new branch
• git checkout <name>; switch HEAD to a branch
• git checkout -b <name>; create a branch and
switch to it.
• git branch; show a list of all the branches.
28. Merging
• git checkout master; first change into master
branch
• git merge <name-of-branch>; merge branch
with master branch