Gotta Grok Git

Git is a file syncronization, and source control tool. Git has been my enemy. It’s still a spooky animal. Here’s how I survive git now without letting it get in the way of me breaking new things.

Install Git Ubuntu/Debian linux:
sudo apt-get install git-core
(refer to references for windows or mac installs)

Setup:
git config –global user.email you@bigco.com
git config –global user.name “Your Name”

Setup new repo?
cd myprojectdirectory
git init
git add .
git commit -am “first commit message”

Grab a repo?
git clone git:repo/proj.git

Status:
git log

Good commit habit to a remote repo:
git commit -am “my new commit”
git pull repo
(no conflicts?)
git push
(if conflicts?)
*run around screaming and breaking things*
git mergetool
or read here

Revert:
git revert commitnumber
Or to revert one commit
git revert HEAD

Branch:
git branch mybranchname

Switch branch (changes files think lazy susan):
git checkout mybranchname

List branches:
git branch

Merge branch master into current branch
git merge master

References:

Share and Enjoy:
  • Digg
  • Facebook
  • Google Bookmarks
  • HackerNews
  • Reddit
  • StumbleUpon
  • Twitter

About Mark Essel

I’m Mark Essel, a dataminer & systems engineer that’s added cofounder, web developer and author to my bag of tricks. My quest is to rediscover my life’s passions, and leverage that drive into profitable business ventures.
This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.
blog comments powered by Disqus