Hadrian Blackwater
Hadrian Blackwater

Reputation: 487

How to push eclipse workspace projects to git using GIT CMD desktop application?

I would like to synchronize all my eclipse workspace to a github repository. Please tell me the list of commands to do it.

Upvotes: 0

Views: 904

Answers (3)

Vinoth
Vinoth

Reputation: 9734

To access Git commands from CMD. You have to set the PATH Environment Variables to Git's bin directory, mine is C:\Program Files\Git\bin.

Then configure your information for all local repo

git config --global user.name "[name]"
git config --global user.email "[email address]"

Create your repository on GitHub. Then go to your project directory(eclipse workspace projects) git init [project-name] and add all files to staging area git add --all or git add * Then commit it with some message git commit -m “Initial Commit” and then git remote add origin <url> then push your files to GitHub git push origin master

See this GIT CHEAT SHEET to know more...

Updated : Here is the link to download GIT Cheat Sheet PDF.

Upvotes: 1

Code-Apprentice
Code-Apprentice

Reputation: 83527

If you cloned your Eclipse workspace from a GitHub repository, all you need to do is

git push origin master

If you didn't, you first need to create an empty repository on GitHub. Then copy and paste the URL at the top of the page for your new repo. From the command line type

git remote add origin <paste URL here>

Now you can use the same git push command as above to push your git history to the new GitHub repo.

Upvotes: 1

Dirar Houimli
Dirar Houimli

Reputation: 61

Take a look ! GIT CHEAT SHEET

Upvotes: 1

Related Questions