5

I have Git setup on an Xcode project and I make many small local commits before I push them to the server. However, I am not able to tell easily what all of the file changes are if I would do a git push. I know that you can look in the organizer and see all of your individual commits, but I can't seem to find an aggregate view of these changes.

Essentially, if I commit changes locally to a file multiple times, I want to see the aggregate of those changes before I push the file to the server.

Does something like this exist in Xcode, or in some 3rd party tools for Xcode?

lehn0058
  • 19,977
  • 15
  • 69
  • 109

4 Answers4

11

Command Line

git diff --name-only origin/master

Will list the files that you have changed but not pushed.

git diff origin/master directory_foo/file_bar.m

Will list the line by line diff of all the un-pushed changes to directory_foo/file_bar.m.

GUI Tool

If your looking for GUI Tools for a Git workflow, I use Xcode to commit locally and SourceTree to push and pull. Before Xcode and SourceTree I was a diehard command line SCM person. But I really like committing locally with Xcode, it streamlined a multi-step process of reviewing the change diffs and committing very nicely. The more I've used SourceTree the more I like it and the less I use the command line. I've always liked Atlassian's products and the $10 license for indies and small startups rocks. Now I just Love them to death for buying SourceTree and making free on the Mac App Store.

enter image description here

I think SourceTree does exactly what you want to do. On the tool bar the red 3 shows I have 3 commits to push. You just select master and origin/master to get an aggregate of what will be pushed. The bottom left pain shows the files changed and the right shows the aggregated diff for that file.

FYI: Two awesome presentations on Git (Absolutely Must Watch)

Git For Ages 4 And Up http://www.youtube.com/watch?v=1ffBJ4sVUb4

Advanced Git http://vimeo.com/49444883

GayleDDS
  • 4,443
  • 22
  • 23
1

You can tell the changes of your local repository vs your remote repository from the Terminal in your local repository directory by using the command

git diff [local] [remote]

for example:

git diff master origin/master
rubenjohne
  • 11
  • 1
  • I don't want to see the files that were changed, I want to see the aggregate changes to specific files. I have updated the question to be more specific. – lehn0058 May 16 '13 at 02:02
0

Use git show to retrieve the commits you made.

Get the SHA identification of your commits and:

git diff 0da94be..59ff30c

Another option is:

git diff origin/master

The command above show the diff of the files to be pushed

Source: https://stackoverflow.com/a/3637039/2387977

Community
  • 1
  • 1
Dherik
  • 17,757
  • 11
  • 115
  • 164
0

I tried with Eclipse and found it very straight forward.

Right click project, 'Compare With', 'Branch, Tag or Reference' enter image description here Under 'Remote Tracking', select 'origin/master' I got the full list of files modified.

SyAu
  • 1,651
  • 7
  • 25
  • 47