After making changes to a tracked files in a Git repository, GitKraken allows you to view default hunks per file. You are given the option to Stage or Discard these hunks.
git add --patch provides the option to split hunks into smaller hunks. I am wondering whether this functionality exists within GitKraken and, if so, how to utilize it.
In Gitkraken's diff view you can stage/unstage/discard multiple lines by selecting them (click and drag over the lines, the text of the lines is now marked blue) and then right click to choose what you want to do.
For staging single lines there is also a green plus which appears next to the line when you hover your mouse over it.
Click on the green plus to stage the line.
This Gitkraken support site shows this in the following screenshot:
Related
We use AzureDevops. In Team Explorer, the changes area shows the modified files to check in. Some have an asterisk beside them. What does the asterisk mean? I think they are files that have been touched / modified, but are still identical to the ones in the git repository. Is that correct? They are definitely saved, unlike the asterisks on file tabs.
Some have an asterisk beside them. What does the asterisk mean?
Normally the asterisks in changes panel should correspond to the asterisks on file tabs. See:
The asterisk besides Program.cs file change panel means that we've done some changes to Program.cs file in solution explore while we haven't save this change in file system.
Normally if we click the Save All(Ctrl+Shift+S) button, then the asterisks should disappear both on file tabs and in Changes Panel. If that doesn't work well in your current project, save all changes and then restart VS or reload the project to check if the issue goes away.
When creating a code review via Crucible/Fisheye, I upload a patch file of local changes, generated using SVN's right-click context menu in windows (right click -> Create Patch), and successfully anchor it.
After this, some reviewers make comments and I agree to implement their changes, and so I do. I then create another patch file from my new set of local changes and upload it to the review, making sure to anchor it as well.
Now, when sliding the 'iterations' bar at the top of the review, there is no longer a way to compare changes relative to the checked-in 'baseline'. If the bar stretches from the original revision/baseline on the left to the first patch like so;
there are no changes shown in the diff view(s), almost as if the first patch uploaded has taken on the role of a new 'baseline'. The 2nd patch is always viewed in relation to the first patch, even if I stretch the iterations bar to start at the original, like so;
This looks identical to if I only compare the first patch and the second (without baseline) like so;
Why am I losing the ability to compare to baseline as soon as I upload the second patch? The diff is fine against baseline if I only upload the one patch file.
We are using git. I am using eclipse. Some of the committers may not be using eclipse. Here's what is happening.
I make a small change in an existing file (properties/xml/java) and save it and commit it.
gitk (without ignore space change) and eclipse thinks the whole file changed. The commit shows ## -1,354 +1,354 ## which means the entire file changed.
When I check for code change difference, with ignore white space, then I can see the text difference. But I don't know what white space change is causing this.
How do I detect what white space difference is there between two files? It could be new line character, carriage return, tab, or something else.
This is how eclipse compare editor works. Unlike other file compare tools(kdiff3 or winmerge or Beyond compare) it shows entire file instead of showing only the difference.
But you can jump to individual changes by clicking on the change book markers as highlighted below.
You can integrate other compare tools(Ex: Beyond compare, winmerge) in eclipse.
Refer these links
Beyond Compare with git
Winmerge with git
Edit:
White space changes are shown in GREY background color
Okay, I have another newbie question. I'm starting to work with a remote code repository, remotehosting.com, and have been given a username, password, and URL. I've been able to successfully associate my project with a remote source code repository, have checked out/pulled down the source files, and have now made a small change to a single file. Here's where my questions start.
1) I can't see anywhere in my GUI where Xcode realizes that I have made a change to a file
2) How do I check my files back in?
I gotta be missing something. The docs I've been reading point to more menu items that I currently see under my SCM menu item. Anybody have any ideas? Thanks in advance for your assistance!!!
File -> Source Control -> Commit, Select the files that you want to commit, add a comment and hit commit button.
This is the flow for xcode 4
In Xcode 3...
The Project window should have a column which displays the SCM status for your files. This can appear both in the "Groups & Files" outline view in the left pane and the file list in the right pane. The icon for the column is a little cylinder shape, a black-and-white version of the yellow cylinder that's shown when you manage repositories. If this column is not displayed, you can right-click on the header of either of those panes to bring up a menu with a list of columns. Select "SCM" from that. The status will display as the same one-letter codes that SVN uses on the command line.
In order to commit files, you can either a) select the particular files, or group you want to commit and use the menu command SCM>Commit Changes..., or b) Select SCM>Commit Entire Project... (which I personally have bound to ⌥-⌘-C in the Xcode key bindings preferences).
Either of these will display a sheet in which you can enter your commit message; the text field in this is very handy in that it accepts the Return key as a newline, rather than passing it to the "Commit" button, but could be confusing the first few times. Press ⌘-Return to activate the button and perform the commit.
I created a label using the new label context menu:
I defined the parameters as follows: (unlocked)
Label:
ms_test
Description:
Created by ms
view:
//depot/Projects/Shared/...
//depot/Projects/AddIn/...
The label is created and shown in the label pane but when I select the label and click on the "List files at ms_test" menu item the log message states "Label ms_test points to 0 files".
Any ideas about why the label is not pointing to any files? How can I make this label to work?
thank you in advance.
Note: I have checked that the view paths are correct and there are file contents and subfolders under then.
I am using P4 client version 2006.1.105584 with no filter on the depot and my client is set to client view of the depot
That means no p4 labelsync or p4 tag commands occurred after the p4 label took place.
Did you create the label as described here?
The following instructions apply to the Windows client (P4WIN) only.
Click the label toolbar button to show the labels page.
Make a new label (right-click in the list); Give it a useful description.
Restrict the View to that needed by the project being labelled (See Using Wildcards and - - Excluding Files for examples).
Drag the project files from the depot over to the label;
Select Add/Replace Files Listed in Label… from the popup menu.
Perforce will open a dialog offering to replace the contents of the label.
Click Ok to add the files.
Even if your label currently references no files, you still can sync it with files:
Select the label from the Labels pane
Right-click to bring up the shortcut menu
Select Sync specific files to bring up a sync dialog
Click Select All
Click Ok
I suspect VonC's answer is pointing in the right direction. On a sidenote, it is worth pointing out that Perforce Labels are badly named and work very very differntly to Labels in virtually any other SCM system.
From the Docs
A Perforce label is a set of tagged file revisions. You can use labels to reproduce the state of these files within a client workspace.
Labels provide a method of naming important sets of file revisions for future reference. For example, you might want to tag the file revisions that compose a particular release with the label release2.0.1. At a later time, you can retrieve all the tagged revisions into a client workspace by syncing the workspace to the label.
Create a label when you want to:
keep track of all the file revisions contained in a particular release of software,
distribute a particular set of file revisions to other users, or
branch from a known set of file revisions.
Essentially what this goobledygook means is that whereas most people use Labels to do exactly what a Changelist number does (eg. Mark a particular point in time) it infact marks the set of files currently synced to in a particular client. This is a bizarre quirk of Perforce and possibly the worst design decision they made in an otherwise wonderful product.
You are probably better off taking note of the changelist number you want (generally the latest at a point in time) and the paths you wish to sync to , that is all the information you need to sync to a point in time.
As of Perforce 2010.1, the correct way to do this is using automatic labels, which are really just a way to name a changelist.