0

I am very new to Git perhaps I don't like eclipse's git plugin. So I prefer to use git using Linux terminal.
So consider I am creating a branch using the terminal

git branch test
git checkout test

And I am typing the code in a file without refreshing the eclipse java project will my changes reflect in that branch.

Also let me know the exceptional cases one should consider while using git with eclipse.

Govinda Sakhare
  • 5,009
  • 6
  • 33
  • 74
  • Perhaps check out http://stackoverflow.com/questions/13470311/eclipse-refresh-files-edited-by-external-editor for information about keeping eclipse in sync with the filesystem. Also, if you're looking for a GUI git client, I'd recommend the great (imo) GitKraken: https://www.gitkraken.com/ . Beautiful, friendly, cross-platform. – daf Jul 02 '16 at 11:06
  • I don't like GUI clients, prefer terminal because I can find it on any machine. still thanx a lot – Govinda Sakhare Jul 02 '16 at 11:07

2 Answers2

1

Not a whole lot. The big ones are to make sure that the local clone is known to Eclipse by adding it to the Git Repositories View, and that the Automatic refresh options on the main Git preference page and Refresh using native hooks or polling on the Workspace preference page are enabled.

There's nothing wrong with using the git command for your work and having eGit installed just to make modifications and branch information more immediately visible in the UI.

nitind
  • 19,089
  • 4
  • 34
  • 43
0

You need to add and commit the changes by git add and git commit command so that they get reflected in your current working branch. See documentation here :

https://git-scm.com/docs/git-add

https://git-scm.com/docs/git-commit

Also, to create a new branch 'test' and checkout it, you can use:

git checkout -b test

rather than :

git branch test
git checkout test

Since you are very new to Git, I would suggest you to go through this tuorial: https://try.github.io/

Manish Kapoor
  • 488
  • 3
  • 16
  • I know the basic concepts, what I am mean to say here is after doing all those things i.e `add commit branch` from git console, If I *don't refresh* eclipse project will it keep writing on master branch? or on test branch. – Govinda Sakhare Jul 02 '16 at 13:13