- Global configurations (these can be seen via the git config --list)
- git config --global user.name "Your Name"
- git config --global user.email youremail@example.com
- git config --global alias.co checkout
- git config --global core.editor "mate -w"
- Initializing a new project / first time repository setup
- git init
- Enhanced .gitignore file
.bundle
db/*.sqlite3*
log/*.log
*.log
tmp/**/*
tmp/*
doc/api
doc/app
*.swp
*~
.DS_Store
- Adding files (this is a recursive command), committing with a message (messages are mandatory), and seeing the log, and the various branches
- git add .
- git commit -m 'message'
- git log
- git branch
- To see pending commits, checkout, checkout to an existing branch, checkout to a new branch, checkin, merge a branch to the current branch, delete a branch
- git status
- git checkout
- git checkout 'existing branch name'
- git checkout -b 'new branch name'
- git checkin -a -m'message'
- git merge 'branch name'
- git branch -d 'branch name'
- Adding to github (these commands are displayed when I create a new repo on github)
- git remote add origin git@github.com:akil-rails/opac_app.git
- git push origin master
Thursday, December 9, 2010
Git Basics
There are tons of tutorials out there, I am posting the snippets that i found very useful from this excellent rails tutorial.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment