GitKraken filter unstaged files by name - gitkraken

How can I filter unstaged files in GitKraken? For example: I want to see only *.cs files in unstaged panel. SourceTree has this feature but looks like GitKraken missed it.

Related

Unable to open folders in GitHub

I pushed a commit on my remote GitHub repo and it appears like this:
In the above screenshot, the top 2 directories appear with a special symbol and strangely I can't click on it or open it. Whereas I can click and open other folder. What could be the reason for that?
The icon is for submodules. Git also doesn't track folders as such. Do you have another .git inside that folder where you have initialised git by mistake?
More verbose explanation of submodules.
https://stackoverflow.com/a/62057615/12040634

Adding a File or Folder to a Git Repo in Eclipse

I want simply add a new File or Folder to an existing Repo in my Eclipse.
I tried the following (add index on the file and folder), but nothing happens.
Can someone help me.
In Git, a new file must first be added to the index (also called staging area) and then committed before the file becomes part of the history:
Add files:
Right-click and choose Team > Add to Index or
in the Git Staging view move the file from Unstaged Changes down to Staged Changes
Commit files: In the Git Staging view enter a Commit Message and click Commit
Result: In the History view a new commit containing the files is shown.
Please note in Git (in contrast to e.g. SVN) only files, but not empty folders can be committed.
Check the properties on that folder to get its path.
Switch to command line, and do a git status (if you have Git installed), to check if the folder and its content is actually in a Git repo (or if only "src" is):
Chec at least if you see a .git folder above the folder you want to add to the index, you should be able to do so from Eclipse.
But if not, that would explain why adding it does nothing.

How to remove git unstageg changes resulted from removing directories?

I had many subdirectories under workspace directory that was under git configuration. I moved some of these subdirectories to another directory. As a result I see thousands of unstaged changed from these deletions, I can watch them from Eclipse. Git diff shows “deleted file mode 100644”.
How to remove these unstaged changes resulted from removing directories?
IF you move elements of a repository outside, it is expected for the Git repo to list those element as being deleted.
You should simply add them (Team > Add), and commit them (recording their deletion).
Once you have done a commit, those files won't show up anymore.
I find it useful to run git add -p, which interactively prompts you to stage all changes in the working directory.
In general, there is a lot more flexibility using git from the command-line than you'll get from within an IDE.

Applying hgignore file to already committed file Mercurial repo

Trying to do something similar to here: Applying .gitignore to committed files
Where you apply the new hgignore file to the already committed files.
I have node_modules folder already committed with thousands of files and I'd like to remove it by using the new hgignore file.
I can't find anything online for it to work on a Mercurial repo, any ideas? Thanks!
Edit .hgignore to match files you want to ignore
hg forget "set:hgignore()" and commit
See in action:
https://asciinema.org/a/kuJERsouDkOUBspADjDM5pMRQ
See also:
hg remove all files listed in .hgignore
How to check which files are being ignored because of .hgignore?
This is very easy once you get the steps. hgignore does not apply to the files already committed for tracking.
I use Tortoise Hg Workbench for UI.
In case build related binary files are checked in that need not be tracked, try this. When a rebuild is done, those files will again appear under files to commit. You can see this by selecting the green Commit button in the toolbar.
Select the files you want to ignore, then right click and select "Forget" (remember you have already committed the file earlier). This would mark the files as "R" for removal. Select the checkboxes next to the file and commit.
After commit, there would be a “?” mark next to those files and will appear in pink. Select those files and right click and select "Ignore". This would bring up the hgignore editor. Add to .hgignore from that editor.
Commit the .hgignore as well so that you have it safe.
In case you are using this for your personal work, why dont you try VSTS, its really cool, has both git and TFS as the backhaul! I moved all my personal work to VSTS.
Note: Sorry for not being able to upload screen shots, absolutely tight on schedule.. :(

Can't add new file to repository in EGit

I'm using EGit with Eclipse Juno.
I worked with a local repository and the world was good.
Even adding a GitHub repository seemed to be fine. I added it to my local repository under "Remotes", so I can easily push commits to github.
But after a while, I noticed that no new files are added to the repository, even if I'm commiting changes.
They just are not under version control. They have no symbol, which should mean they are ignored.
This is my .ignore
.gwt
gwt-unitC
ache
Versandanzeige_Web_proto.war
Versandanzeige_Web.war
war/ajax
war/WEB-INF/classes
war/WEB-INF/deploy
www-test
The files are in src, so not even close.
The new files don't appear in the Commit-Dialog, even when checking "show untracked files". They don't appear in the Staging-Window.
RK -> Team -> "Add to index" doesn't help.
The files have the same right and are owned by the same user
They definetly dont show up at github
Any ideas how to fix that? Any additional information needed?
Update:
There are no errors in the error log.
I do have (HEAD) next to my newest branch.
More details:
I got my trunk T, beginning at T0. At T1, there is a branch A, which has changes to T1.
At T2, there is another branch, B. It has no changes to T2.
The strange thing: it is not indicated in History view. The master branch is also missing.
I can still switch to them. When I do git reflog, there are no entries before or including T2, just everything afterwards.
I removed the branches without commits:
The new files are still shown as ignored:
Output from command line:
$ git branch -a:
* master
maven
$ git status
# On branch master nothing to commit (working directory clean)
About the detached HEAD proposel: I didn't do what is described in the article, checking out an old state and work from that. And I can't see any undone commits.
Sorry for my bad english, I didn't use it for a while. Please ask for clarification, if I write something hard to understand.
Update:
I could add a file in another folder (/Versandanzeige_Web/war/WEB-INF/lib/gwt-servlet.jar).
Alright, I found the error.
For some reason I don't really know, there was another .gitignore file ABOVE my Project folder (in repository folder), where my COMPLETE project folder was included. I really don't know how that happened. Of course, this file didn't show up in Eclipse.
I tried to add the files on the command line, but gut the error message "File is in .gitignore file".
After deleting that file, it worked find.
Sorry for the trouble.
Sometimes EGit does not work properly and add to index does not work. In that kind of situations you can go to the root folder of your project (where .git folder is placed) with a file explorer, right click on an empty area inside the folder, select "git bash". This will open the git console for you. Now type "git add path_to_file". This will add the file to the git system for indexing. Now go and refresh your project in eclipse and you will see it is added to the index. This can be used wile resolving conflicts inside eclipse because adding to the index indicates "mark as merged" to the git system by re-adding the merged file.
Also sometimes the "Remove from index" does not work in eclipse, you can do the same thing in that kind of situation: this time write "git remove --cached -f path_to_file". Here do not forget to add "--cached" because otherwise your file will be deleted. -f stands for "force" to force the command. For any folder (directory) to remove from index type "git remove --cached -r -f path_to_folder".