With Unstaged Changes
This one is easy, nothing special needed.git status
# On branch master
# Changes not staged for commit:
# (use "git add..." to update what will be committed)
# (use "git checkout --..." to discard changes in working directory)
#
# modified: changedFile.m
#Now run the command to add a diff of the modified files:
ccollab addgitdiffs new
With Staged Changes
This is not very tricky, but you do need to give the git diff option for staged files, --cached.git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD..." to unstage)
#
# modified: changedFile.mNow run the command to add a diff of the cached/staged files:
ccollab addgitdiffs new --cached
With Committed Changes
This one is more tricky. You have committed the files. Let's use reflag to see the commits. Then take the SHA1 hash of the commit you want to diff and the previous commit do a diff between commits.git status
# On branch master
nothing to commit (working directory clean)
As you see, git status will not show any changes since you committer your work.
git reflog
aa90bc4 HEAD@{0}: commit: Changes I forgot to code review.
bb37e6c HEAD@{1}: commit: Some other changes
......
Now use the SHA1 hash of each commit to make your diff:
ccollab addgitdiffs new bb37e6c aa90bc4Now you should have a code review with the difference between your changes and the previous commit.
Hope that helps
No comments:
Post a Comment