How can I see what files Git is going to push to the server in Xcode?
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?
4 Solutions collect form web for “How can I see what files Git is going to push to the server in Xcode?”
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.
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.
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
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]
git diff master origin/master
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
I tried with Eclipse and found it very straight forward.
Right click project, ‘Compare With’, ‘Branch, Tag or Reference’
Under ‘Remote Tracking’, select ‘origin/master’
I got the full list of files modified.