Posts Tagged ‘git’

Typical Usage of Git

# get the sources for the first time
git clone git_repo_url

# check out branch
git checkout master ( or your own branch)

# write code
git commit -a -m “try best to make your comments meaningful”

# pull latest changes to avoid massup due to auto merge
git pull –rebase

# Post code review to the reviewboard
post-review –guess-summary –guess-description
post-review –guess-summary –guess-description –revision-range HEAD~3:HEAD

# If code change needed per review comments

## if only commit message change needed
git commit –amend

## if both code and commit message change needed
git reset –soft HEAD~1
modify code
git add /path/to/new_modified_files
git commit -c ORIG_HEAD

# Post another review based on the previous one
post-review -r the_previous_review_num

# Ready to push
git pull –rebase (merge with changes made by others)
git push


Read Full Post »