How to ignore files via GUI in Gitkraken? - gitkraken

I come from SourceTree to board the GitKraken hype train. It has always been pretty easy to ignore files within ST. Just right-click on a file in the unstaged container and you've all the options. You can ignore the files directly, each file beneath a specific folder etc. (so, all the .gitignore stuff from within the GUI =)).
However, I can't find a similar feature in GitKraken. Does anybody know how I can ignore files via the GUI of GitKraken?
Please note: This is not a git question. I absolutely know in depth how ignoring files in Git work. But that's not the topic whatsoever. This is just a trivial GitKraken support question.

Currently there isn't an option to ignore a file through the GitKraken GUI.
If you check their post on twitter this is planned to be implemented soon and it will be in their release notes once this is completed.
UPDATE (26.01.2017.):
Version 2.0.0 brings the .gitignore option to the list of functionalities. You can now select a file or folder in the file staging area, and add to the .gitignore file on the fly. Right-click and select Ignore. From there, you can:
Add that specific file to .gitignore
Add all files with that file extension to .gitignore
Add all files in the same folder as the selected file to
.gitignore
(If selecting a folder) add that folder to the .gitignore

Related

How to hide ignored files in GitKraken?

so I have updated my version of IntelliJ and Jetbrains decided to create new files and folders on my code folder. (see screenshot below)
I don't really want Jetbrains/IntelliJ clogging up my repo so I decided to add this entry on the .gitignore on the parent folder (e.g. /Users/myuser/Documents/myrepo/.gitignore)
##########################
## Jetbrains/IntelliJ
##
.idea/
.idea_modules/
*.iml
My problem with Gitkraken is that it continues to show all files and folder (as unstaged) inside "/Users/myuser/Documents/myrepo/.idea" even after I restart the app. I'm not sure if this matters but I am using the Gitkraken macOS version.
Some things to try:
Commit your .gitignore first. (Just a guess)
There is an option in GitKraken to ignore files individually, Right-Click (on the unstaged file) -> Ignore. This will add it to .gitignore.
The best way is to use a global ignore file like what is demonstrated here
GitKraken reads the global ignore file as well as the ignore files in the repo.
It does require a little bit of command line use but not much.
create a file in your home directory touch ~/.global_gitignore
add things like the .idea and other things in that file you never want in any repos (including OS specific things) see https://github.com/github/gitignore for many helpfil things to add
run the following command git config --global core.excludesfile ~/.global_gitignore
Enjoy never needing to exclude them from your repos again.

how to rollback the ignore state of a file/folder in git using eclipse

accidently I set the ignore state for a folder in GIT in eclipse.
context-menu on the folder -> team -> ignore.
How can I activate this folder for GIT again ?
I guess it must be team -> add to index, but this doesn't work for me.
any help ?
Click Ctrl+shift+R and type .gitignore in eclipse.
Open the .gitignore file of respective project.
All the ignored file's path will be displayed here.
Now remove the paths of files which you want to unignore and save it.
Again the files will be back to its original stage and can be added to staging area.
Steps to make file unAssumed ignore
If you don't want your files to be ignored then do the following
Go to the file you don't want to be ignored and rightclick it --> Team --> Advanced --> No Assume Unchanged
Please find the same in image
See this bug right now there is no way to find all ignored resource in a git repo using EGIT.
When you do Team context-menu on the folder -> team -> ignore it will automatically create a .gitignore file inside the parent folder and this file is added automatically to git index and will be shown in git staging view.
After committing this file it is difficult to find all ignored resources in a given git repo. Go to your file explorer and search for all .gitignore files inside a git repo and view their content.
In the base directory of the git project, there will be a file called .gitignore (Note the dot at the start of the filename).
This file lists all the files, directories etc that are ignored by git.
Simply edit that file, removing the line which corresponds to the folder you accidentally added.

Git ignore won't work, but eclipse ignore works?

I have a dynamic web project in eclipse. I used the Git GUI tool to place it under source control.
Then, suddenly my project icons were decorated with git related images. Anyway, after that
I wanted to keep the content of the images folder (inside WebContetnt folder) out of source control.
So, I went into my project folder and modified the .gitignore file adding /WebContent/img/*.
This does not change anything in eclipse.
So, I used an alternate approach. Project > Team > Git > Ignore. This works and the question
mark image on the img folder icon vanishes.
I am not able to understand why my manual change does not work and also how eclipse suddenly
put it into source control. Please help me to understand.
Thanks.
To ignore contents of the folder you have to have a folder name + forward slash and no asterisk: WebContent/img/
And, as #janos noted, don't forget to refresh your project/repository after manual change of your .gitignore file

Subclipse SVN first commit ignore certain directories

Decided to take the jump from CVS to SVN.
I setup a new repository in subclipse for my project. When I go to 'Finish' the setup it wants to do an initial commit and presents me with a flat list of files to select the files for version controlling.
The problem is I have thousands of generated binary files I dont want to commit.
So I click on cancel because it would take me all day to go through and unselect all the unwanted files. Annoyingly when I click on a parent category for the files I want to ignore it is not recursive!
So I click cancel then go to the eclipse directory structure for the project and manually set svn:ignore on all directories I want to ignore. Then I try and do a commit again and all the files are once again presented - ignore seems to have done nothing.
Can anybody point out what I might be doing wrong?
For the first commit, I recommend writing a small script to delete (of course you'll have a backup) all the files that are not meant to be committed.
Afterwards, if you find you accidentally committed a file, you can
svn delete file
Upon the first checkout, copy back (or better yet, regenerate) all the binary files. This will trigger svn to notice that your local repository is out-of-sync with the remote repository.
cd <Root of local repository>
svn status
You will see lots of "to be added" items. Go to the parent directory and add in svn:ignore properties for each of the generated items.
cd build
svn propedit svn:ignore .
which will open an editor (if it doesn't, you need to set the environmental variable SVN_EDITOR to a suitable editor). Then you can add in entries that svn will know are not tracked.
(in the ignore property editor)
target
build
image*
*.o
(and so on)
Save the file, and it will be staged for the next commit. Subsequent runs of svn status will no longer show these files as "needing to be added", but they will show the directory as "needing to be committed (it's a revision on the directory)"
Quick Aside
So I'm not entirely certain exactly which functionality of Subclipse you were using in order to create a repo and share a project to it, I'm assuming you created like a file based repo through the eclipse SVN repo view and tried to share and then commit to it. It looks like your problem got solved but I did want to add an answer on here because I ran across this post looking for the answer to this same problem of handling initial commits even just in general with SVN and wanted to offer help to anyone else looking for the help.
Intro
To start off I would recommend not working through an IDE extension like this just for the initial commit as they can miss a lot of the options for handling opening a repo in SVN. I personally really like the command line form of SVN to work with but TortoiseSVN is a good option for a GUI.
Whether you create a local file-based repo or are connecting to an SVN server and you want better control over your first commit in an previously unversioned project here is what I've found as the best general workflow for doing so.
Create the remote folder to save to.
On command line this will be:
$> svn mkdir your-url-scheme://your-site-address.domain/path/to/repo/example-directory
Or on TortoiseSVN open your repo for browsing, right click, and select "create new folder"
This will give you a location in the SVN repo to checkout from for our next step.
Checkout in to the already started project
Make sure to use the empty, newly created folder in your repo to checkout with. SVN does not actually require a folder being checked out to to be empty, which is an important part of what makes it actually very flexible and able to subsume parts of your directory into it fairly easily if used correctly.
Now you will checkout this empty folder into the root folder of your already started project. This will add your project to the working copy of this folder without any commit being made yet. The command is:
$> svn co your-url-scheme://your-site-address.domain/path/to/repo/example-directory /your/projects/root/
"co" standing for checkout. In Tortoise svn you can right click on or in the empty repo folder and select "checkout..." and then select the project root.
Set ignores and commit
Finally, you can easily set your ignores on certain files before adding any other files to the tree using the command:
$> svn propset svn:ignore file-or-directory-to-ignore
And to add all non-ignored directories and files:
$> svn add * --force
The force is technically unnecessary in this case but ensures full recursion. You can also now do all of this in your file explorer if using TortoiseSVN or you can even use your IDE extensions to do this at this point(make sure to ignore all files you need to before mass-adding files for commit), all that's left is to make sure to commit the newly added files to the repo and you're up and running with source control :)
Added this method here simply because this method allows you to avoid any unnecessary copying of those stinky binaries that no one wants to lug around with them.

exclude some files from synchronization with SVN , eclipse IDE

Is it possible to exclude/ignore some specific files from synchronization with SVN that are present in svn ??
These files are already present in SVN, and I believe from other posts that the rightClick->Team->SVN:IGnore only works for files that are not there in svn.
I have read other posts but can not find the answer.
Reason : we have some files that have some specific content in SVN while some other content in local workspace, People by mistake are checking in theirversion of these config files to SVN.
Perhaps there is an easier way to do it, but following should work:
Optional: save your file somewhere, in case you can't recreate it
Open 'SVN Repositories' view, navigate to location of file you don't want to be in SVN, right click on it and choose 'Delete'. This would remove file from repository
Synchronize. You would see file removal as incoming change. Accept it. This would remove file from your local file system
Recreate file in your local file system, or copy from step (1). File would show as outgoing change if you synchronize at this point.
Now you should be able to do 'Right click->Team->Add to SVN Ignore' on it. Do this and commit property change on the folder.
TortoiseSVN has a option in the Windows-context-menu by right-clicking on the file to unversioncontrol and add to ignore list. The action should also be recogniced by the plugin, even if the plugin menu has not this option.
If you do not want to use Tortoise for this, a simple workaround would be:
remove the files from the folder(store them temporaly else where)
commit, the removed files.
if you are not on the commiting computer update now
paste back in the removed files and add them to the ignore list.