Wednesday, December 19, 2012

Setup git in eclipse


Open eclipse
Create New Project
a.       File -> new -> java Project
b.      Enter project name, and finish creating project
Project Name: git-demo-setup


Finish creating the project.


Now to setup with github, right click on project “Team”->”Share Project…”



Select Git.







When selected Next in above screen, check the checkbox and select the project.

Select create Repository button


Say finish



In the Git Repositories View (in eclipse)



Expand the repository.



Do the following steps.



Remote name: git-demo-setup















Say add.
Start typing master in remote branch and select master from drop down.
(Don’t check force update)






Select add.



Say finish



Open config file
Current content are:
[core]
       repositoryformatversion = 0
       filemode = false
       logallrefupdates = true
[remote "git-demo-setup"]
       url = https://github.com/sravanreddy001/git-demo-setup.git
       push = HEAD:refs/heads/master
       fetch = +refs/heads/master:refs/remotes/git-demo-setup/master

add the below lines (no new line in the end)
[branch "master"]
       remote = git-demo-setup
       merge = refs/heads/master





Try merging









If it give any error while merging,
Goto synchronize project and mark the project (or) files as “overwrite” or “merged” to get rid of that error.





No comments:

Post a Comment