Skip to content

Git Basic Concepts

saich edited this page Feb 14, 2011 · 1 revision
  • Unlike many SCMs, a 'git commit' is local to your development machine only, and no changes are done in the remote server. To share your changes (make visible to all), you need to push to the remote server.
  • You can make multiple commits & then push them all at once (an encouraged practice).
  • Before you push any changes, you need to run 'git pull', which gets the updated code (if any) from the remote server and merges them with your commit changes.
  • Unlike Perforce or any other SCM, the content of a file being committed is not the content on the file. Only changes (not same as files) that are added to the stage goes into a 'git commit'
  • Some commonly used commands would be:
    1. 'git pull' - Pull the changes from the server and merge them to current working files
    2. 'git push' - Push the local changes/commits to the remote server
    3. 'git add --all' - Add all changed files to the stage for next commit
    4. 'git status -s' - View the status of the files currently on the stage
    5. 'git diff head' or 'git diff' - See the changes made to the files from the last commit

For non-committers
We use 'Fork + Pull' model to accept changes from a person outside the team. Basically, you 'fork' the project, make changes on your dev machine & push them to your forked repository, and then, send us a 'pull request'.

Clone this wiki locally