gitx(L): view files that need committing - gitx

In gitx(L), is it possible to view all the files that need to be committed?
For example, it would be handy to have a pane that shows the list of files that have changes. However, I can't seem to see one.
Any suggestions?

You can find this list in the staging dialog, accessible from the upper left corner. You'll see the classic Git commit, with a list of changed or untracked files, and the ability to stage and commit them.

Related

'.pbxproj' file is missing in commits list

currently building a project clone and push all the changes to my github account step by step.
And i always used to see 'Twitter.xcodeproj/project.pbxproj' checked together with modified .swift files.
However, i don't see it now. I've reopened and did some additional changes to the code, but still nothing.
Is that ok, if it's not pushed?
And how do i get it back to normal if it's not?
The list you are looking at is generated by git status. Well, git status does not include any files that didn't change. So you should not expect to see project.pbxproj in the list unless you did something that would change it (like making a new code file and adding it to your project). Merely editing your existing code wouldn't change it, so it doesn't appear.
(In a way, this is a case of the classic confusion as to what git status means. Beginners often think that it's a list of your files, or a list of the files that will go into this commit. It isn't. A commit always contains all your files. But git doesn't bother to list them in the git status, because that could be an unnecessarily huge list. There are ways to find out what's in the commit, but the screen you are displaying is not how to do it.)
TL;DR Don't worry, be happy.

After checking git diff, how can I ignore changes in a few files that I dont want to add to this commit?

Consider I have made some changes in a few files or classes.
FYI: I am an iOS Developer and use XCODE for development.
Now, After checking git diff from terminal, there are a few changes that I want to ignore and not add to the commit that I am about to make. How can I ignore changes in a few files that I dont want to add to the commit? And also, how to make sure that in future commits, it should not get added.
Thanks in advance...
There are two things you need to know about here:
First, how to ignore certain files permanently, even for future changes. This is typically done for files that are auto generated by your code, such as build files, or local settings (a swap file for vim for example). For this, you need to add the file patterns in a .gitignore file at the root of the repo directory. Read more on it here.
Second, how to ignore certain files for the following commit only. For this you can either hand pick the files you want to add by doing git add <file_name>, then the commit will only have these files, or you could stash your changes to the unwanted files, add all files, commit, then unstash. Read more on stashing here.
If these are files that you will never want to commit, then the answer is to use a .gitignore on your repo with the file patterns you want to ignore.
If you have, in the same file, some changes that you want to commit, and some that you don't, then you can do interactive staging. You start it with git add -i and typing p you select the patch option, git will ask you which file do you want to commit partially, you select the file and then git you show you every hunk of changes you made in the file and you select if you want to stage that hunk or not.
If you can use git-gui or another gui this process can be even simpler.

Add files to each branch in TFS

I have 55 branches in various locations. For example $/Repo/Trunk, $/Repo/Branches/branchNames, $/Repo/Features/branchNames, etc. I want to add some files to every branch. I scripted a copy and paste to put the files in the subfolder under each branch where I'd like to add them.
I then navigated to C:\TFS\Repo (my workspace for Repo) and searched for NewFile. Windows explorer brought up a list showing the 500 new files I'd just added across the 50 branch folders. I highlighted all of them, right-clicked, chose Team Foundation Server -> Add.
Here's my problem: it only added ten of them. I don't want to go back and redo that process, making sure to deselect everything I've already added (because if it's selected, the 'Add' option is disabled), and repeat this process 50 times. I also tried a script that will recursively search for files starting with NewFile and add them but it only added 300 of them (not sure why).
Am I missing something or is there no easy way for me to add all these files at once?
It sounds like you are using the File Explorer extension. Add the files via the Source Control Explorer in TFS. Right click on the root folder for the branches and choose Add Items to Folder. The dialog will show all files that could be added (including subfolders) and you can include/exclude as necessary.
This method will break the branching model for those files. After checkin there will be no branch relationship between the files and they will never merge.
You need to add the Files to one of the branches and merge them through the branch structure.
Ideally you would add them to your MAIN/TRUNK/MASTER and then merge that out to all of your DEV and FEATURE branches. You are unlikely to want to do this for RELEASE but I can imagine senarios where this would be necessary.

TFS 2010: history lost after moving a folder

In order to clean up my project structure, I moved a folder into another (new) folder through the TFS Power Tools Shell-Extension (Rename/Move).
After checking the history at the new place, the move is the only entry. (I tried one folder up, down, even on single files in the moved folder.. same result.)
I had also put on some labels on versions of the folder before the move, since there were some important states of the code I wanted to get back to.
So.. what went wrong, and how can I either get the history or at least find out the label names again and check out those versions?
Turns out it is pretty easy.
In Visual Studio 2010, go to Tools->Options. There you can find the option to show "deleted" items (roughly in the middle of the dialog box). The old folder got deleted during the move - it will be displayed again after activating that option. (They will be kind of grayed with a red cross.)
Labels seem to have disappeared, though, so I had to go by version.
In the Source Explorer you have the normal operations again - like View History or Get.
DISCLAIMER: For reference of everyone that gets here, this answer is not fixing #Andreas problem, just giving some context on why this happens and offering a couple of workarounds.
Seems that losing history when moving folders in TFS 2010 is not a bug, is a "feature". (still happening in TFS2012. From this MSDN link you can read official Microsoft answer:
Thanks for the feedback here. The previous comment about this being by design is correct, and there is an option on the command line. In the UI, history of folders is recursive - always. This is because most of the time, users care about the history of the contents of the folder. Files on the other hand dont have the concept of recursive history - you always see the history for the file itself. Now, from the command line, there is an option to show recursive history (/r) and if you run tf history on a folder without the recursive option, you'll see the changes to the folder itself. This would include changes such as a rename for the folder itself.
Workaround to get history once lost: As you can see there, you have a workaround using tf history.
Workaround to avoid losing history: If you want to avoid losing history in folders instead of using move feature, you can use TFS Integration tool to migrate code from one folder to other preserving history, migrating from $/TFSCode/FolderA to $/TFSCode/FolderB. It is a little bit overkill but if the history is pretty important for you is much better than looking for it in deleted folders
It is true that the folder history is lost, but the individual file history is actually not lost. It is hidden under the little "expand me" arrow at the far left on a file history line. Expand it on the oldest history entry for a file, or anywhere you see it, and you will see history of that individual file also from an old location that no longer exists.
At the top of History window you can edit Source location, put the old name and get the full history before it has been moved.
Also, is good to mention that you can get the full history back by moving/rename the branch back to the old location/name.

Viewing the contents of previous commits in Xcode

In Xcode when I go to Organizer -> Repositories I can see the list of
all the commits I've made sorted by dates.
For any commit, I can expand the viewing area by clicking the disclosure triangle to the
left.
This shows me the list of file that were
added/modified/deleted in that commit.
I can click any file in his
view to open the versions editor and view the diferences from my
working copy.
Now here's what I'd like to do: I'd like to do is view the contents of files that I deleted in this commit. Is there a way I can view them from within Xcode? It looks like one can only see which files were modified and what those modifications were. There seems to be no way to view contents of deleted files.
Can someone prove me wrong?
I don't know GIT, for Subversion the situation is as follows.
Deleted files are handled differently in Subversion and thus most clients have trouble getting information about them, so does XCode. The only way I see is to use the command line. You need to know at which revision the file was deleted. Let's say this number is 101, so at 100 it existed yet.
Open a terminal and type:
svn log https://myserver/myrepos/mypath/DeletedFile.m#100
svn cat https://myserver/myrepos/mypath/DeletedFile.m#100
You can even perform diffs. To compare revisions 85 and 90:
svn diff -r 85:90 https://myserver/myrepos/mypath/DeletedFile.m#100

Resources