Below are some commonly-used operations when interacting with code.
In order to work with code, you must have a local copy of it. You will find the path to clone at the top of the fork.
git clone firstname.lastname@example.org:drupal/d7.git
After you’ve made some changes to your code, you’ll want to verify your changes before committing them. This will output a list of modified files for analysis.
Git has a staging area that modified files must be added to before they can be committed. This allows for easily breaking changes up into separate commits.
Example: Add an individual file:
git add filename
Add all modified and deleted files:
git add -A
Records a snapshot of your changes. Always include a comment with what was modified.
git commit -m"Added CSS to style the home page."
Your commits aren’t pushed immediately to the remote repository when committing. This pushes your changes to the remote repository.
git pull –rebase
If changes have been pushed to your fork by other users, you will need to pull them in before you can push. This pulls those changes in and applies your changes on top of them.