DOGHOUSE UNIVERSITY - Git Basics
-
Upload
doghouse-university -
Category
Software
-
view
52 -
download
1
Transcript of DOGHOUSE UNIVERSITY - Git Basics
What is git?
1. Source Control Management System (SCM)!
2. Distributed!
3. Speed!
4. Data integrityhttp://www-cs-students.stanford.edu/~blynn/gitmagic/ch08.html
Built by Linus…
https://www.youtube.com/watch?v=4XpnKHJAok8
Remotes
1. git clone <url>!
2. git remote add <remote> <url>!
3. git remote set-url <remote> <url>!
4. git push <remote> <branch>!
5. git pull <remote> <branch>
Squash
git merge —squash <branch>
# Reset the current branch to the commit just before the last 12: git reset --hard <commit> !# HEAD@{1} is where the branch was just before the previous command. # This command sets the state of the index to be as it would just # after a merge from that commit: git merge --squash HEAD@{1} !# Commit those squashed changes. The commit message will be helpfully # prepopulated with the commit messages of all the squashed commits: git commit
Option 2
Option 1
Don’t be evil!
1. Commit often!
2. Check your diffs BEFORE pushing git diff, Gitk, SourceTree App!
3. Do not add/commit blindlygit add -A .git commit -m “More styling”!
4. Create Pull Requests often!
5. Branch for everything!
6. Think of what the history will look like!
Let’s Play!
1. http://pcottle.github.io/learnGitBranching/!
2. https://github.com/Gazler/githug