11.11.2013

Git Cheat Sheet

1. Initial git configuration
$ git config --global --add user.name "Sam Dela Cruz"
$ git config --global --add user.email "samdc@mail.com"
2. Verify configuration
$ git config --global --list
user.name=Sam Dela Cruz
user.email=samdc@mail.com
3. Tell git which files are not be be version controlled
$ vi .gitignore
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
#   git config --global core.excludesfile '~/.gitignore_global'

# Ignore bundler config.
/.bundle

# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal

# Ignore all logfiles and tempfiles.
/log/*.log
/tmp
4. Initialize repository
$ git init
5. Add all files
$ git add .
6. Commit
$ git commit -m "Project Scaffold"
============
Searching
============

1. History of code changes...
$ git log -L :start_perfcloud_run:./api/api/orchestrator/tasks/job_tasks.py

No comments:

Post a Comment