Some common git usage --------------------- To ignore certain files: $ echo "log/*.log" >> .gitignore $ echo "tmp/**/*" >> .gitignore $ git add . $ git commit -m "Add files" To create a public repository: $ mkdir someapp.git $ cd someapp.git $ git --bare init $ git-update-server-info Add public repository as a remote: $ git repo-config remotes.origin.url [url] $ git push To pull from someone else's repository: # # Create a local branch $ git checkout some_working_branch # # Add the person's repository as a remote $ git remote add foos_remote git://someurl/ # # Fetch her branch into yours $ git checkout -b foos_remote/her_branch # # Pull the changes into your local branch $ git pull foos_remote her_branch Submodule support: $ git submodule add [git-url] [path to local project dir] $ git submodule init # thereafter $ git submodule update
cheat sheets.
$ cheat git_usage( add new | see all )
- updated sheets

- mysql_select
- cheat
- cryptsetup
- burm
- perl
- port
- yuilang
- queriac
- mechanize
- sness
- nonsense
- haml
- git
- assert_valid
- marsmission
Advertisement