If you already have a git repository in place, first copy all your files to that directory (yes, manually) and do a git commit -a to commit all the files into the repository. I'm assuming here that you've already initialized the repository at C:\Users\username\GitHub\project_name\ with git init.

In eclipse, go to FileSwitch WorkspaceOther... and point it to a workspace of your choice that can be completely different than the location of your code, or your earlier workspace. In fact, don't point it to the directory which contains your git repository.

Once you have a clean workspace, go to FileNewOther..., select GitGit Repository and enter the path of your git repository (C:\Users\username\GitHub\project_name\). Enter a name for the repository, and click Finish.

I would really recommend you read at least the first few chapters of the git book to understand how git works, and to help you push and pull code to and from remote repositories.

If your existing repository is not git, you're going to have a hard time keeping the directories in sync. You might want to setup rsync to sync the directories. There is no way AFAIK for eclipse to automagically keep the two repositories in sync.

Answer from Anand on Stack Overflow
🌐
Eclipse
wiki.eclipse.org › EGit › User_Guide
EGit/User Guide - Eclipse Wiki
Create a new Java project HelloWorld. (In this case, the project was built outside of your Eclipse Workspace.) Select the project, click File > Team > Share Project. Select repository type Git and click Next. To configure the Git repository select the new project HelloWorld.
🌐
Vogella
vogella.com › tutorials › EclipseGit › article.html
Eclipse Git Tutorial
May 31, 2026 - Select Window Preferences Version Control (Team) Git Configuration to see the current configuration and to change it. If you clone a new repository via the Eclipse IDE, it will be cloned by default to a new sub-folder in a default directory.
🌐
Eclipse
help.eclipse.org › latest › topic › org.eclipse.egit.doc › help › EGit › User_Guide › User-Guide.html
EGit User Guide
You will have to restart Eclipse ... so it can find the "system wide settings", e.g. how core.autocrlf is set. Go to the settings and look under Team>Git>Configuration and then the System Settings tab....
🌐
DZone
dzone.com › software design and architecture › integration › how to configure git in eclipse ide
How to Configure Git in Eclipse IDE
May 10, 2022 - Let's get Git configured in Eclipse so you can import and perform operations on repos within your IDE.
🌐
Joannakl
joannakl.github.io › thisandthat › gitForEclipse.html
Using Git in Eclipse
In Eclipse go to Windows → Preferences → Team → Git → Configuration.
🌐
Uzh
geo.uzh.ch › microsite › reproducible_research › post › rr-eclipse-git
How to use Git with Eclipse | Reproducible Research Workshop
August 18, 2016 - Type “git” in the search bar, then choose that path ‘Team > Git > Configuration’. Click ‘Add Entry…’. Enter user.name as the Key, and your GitHub username as the Value, then add another entry with user.email as the Key and your ...
🌐
Eclipse
wiki.eclipse.org › Git
Git - Eclipsepedia
The 'commit' record must contain either your Eclipse User ID, or the email address registered with the Eclipse Foundation. git config --global user.email my_committer_email@address.com git config --global user.name "John Doe"
Find elsewhere
🌐
Jmu
wiki.cs.jmu.edu › reference › eclipse › git
Using Git with Eclipse - JMU CS Wiki
August 21, 2025 - The Eclipse plugin that integrate ... you can install it using any of the methods described on the EGit downloads page. To configure Git, click on "Window+Preferences"....
🌐
GitHub
github.com › eclipse-egit › egit › wiki › User-Guide
User Guide · eclipse-egit/egit Wiki · GitHub
(In this case, the project was built outside of your Eclipse Workspace.) Select the project, click File > Team > Share Project. Select repository type Git and click Next. To configure the Git repository select the new project HelloWorld.
Author   eclipse-egit
Top answer
1 of 2
1

You need to tell EGit where the default system configuration is for it to be able to pick up the values. There's a Browse button which should allow you to change it according to the help pages:

https://wiki.eclipse.org/EGit/User_Guide#Pointing_out_the_System_wide_configuration

You can also set this property in the User Settings which Eclipse will respect. Global is 'for all users of this machine' and User Settings is typically stored in your home directory, i.e. 'for just this user'.

You'd have to find where the file that's being created by git config --global on your setup is. It's likely that git isn't on the path, and that's why Eclipse can't auto-guess where it should be.

By the way, unless you really, really need to have CRLF on the files you should prefer to keep them as how they are stored remotely - it will be faster for EGit and Git to perform deltas if it doesn't have to do line-ending conversion on most operations.

2 of 2
1

I had a similar problem so let me add this for clarification: in Eclipse Preferences > Team > Git > Configuration the System Settings Tab was empty and "Location:" said "Unknown". The EGit User Guide (https://wiki.eclipse.org/EGit/User_Guide#Pointing_out_the_System_wide_configuration) tells that "If you selected one of the options to use Git from the Command Line Prompt when you installed Git for Windows, then the location of the system wide settings is filled in with a path and everything is fine. If not, use the Browse button to locate where Git is installed, e.g. C:\Program Files(x86)\Git." Indeed I did not select the option to use "Git from the Command line ..." when I installed Git. But instead of a "Browse" button my Eclipse 2020-09 has an "Open" button and that one was GREYED OUT, so I was unable to tell EGit in the above mentioned "System Settings" Tab where the local Git installation could be found. Furthermore I did not know which path precisely had to be added to the systems PATH variable. I then reinstalled Git with the option to use "Git from the Command line ..." and found out that "C:\Program Files\Git\cmd" was added to the System PATH. After a restart of Eclipse the "System Settings" Tab had the "Location" configured as: "C:\Program Files\Git\etc\gitconfig" and all the missing keys and corresponding values were set.

🌐
Medium
medium.com › @AlexanderObregon › getting-started-with-version-control-in-eclipse-ide-git-and-github-integration-a0cca7b15126
Getting Started with Version Control in Eclipse IDE: Git and GitHub Integration
April 26, 2024 - In Eclipse, go to “Window” > “Preferences” in the top menu. In the Preferences window, expand “Team” and select “Git.” · Configure your Git settings, including your user name and email address.
🌐
GeeksforGeeks
geeksforgeeks.org › git › how-to-add-git-credentials-in-eclipse
How to Add Git Credentials in Eclipse? - GeeksforGeeks
July 23, 2025 - Type “git” in the search bar, ... > Git > Configuration. Click Add Entry. Enter user.name as the Key, and your GitHub username as the Value, then add another entry with user.email as the Key and your email as the Value.
🌐
YouTube
youtube.com › abhay kumar
How to configure Git & GitHub in Eclipse - YouTube
Configuring DevOps - Continuous Integration Automation with Eclipse, Git & GitHub and Jenkins
Published   December 22, 2016
Views   5K
🌐
MCU on Eclipse
mcuoneclipse.com › 2018 › 09 › 30 › tutorial-git-with-eclipse
Tutorial: Git with Eclipse | MCU on Eclipse
September 23, 2023 - For MCUXpresso IDE and SDK projects it is very simple: only the output folder with the generated make and object files needs to be ignored which is usually named ‘Debug‘ and/or ‘Release‘. As seen from the above .gitignore, Eclipse already added this to the list, so we are fine :-). One question remains with the NXP Configuration Tools.
🌐
Eclipse Che
eclipsesource.com › blogs › tutorials › egit-tutorial
Egit Tutorial
Every commit in EGit will include the user’s name and his email-address. These attributes can be set in the Preferences-window Window => Preferences. Navigate to Team => Git => Configuration and hit the New Entry
🌐
GeeksforGeeks
geeksforgeeks.org › git › how-to-use-git-with-eclipse
How to Use Git with Eclipse? - GeeksforGeeks
July 23, 2025 - Step 1: Open Preferences in Eclipse IDE. Then go to Team, then Git & then configuration. There you need to add your user name.