10.1. Basic operations
Once you have placed a project under version control you can start using team operations on your project. The team operations are available via right-click on your project or file.The most important operations are described in the following list. Select:
-
→
to add the selected resource(s) to the index of Git.
-
→ , to open the commit dialog for committing to your Git repository.
-
→
to create a patch
-
→
to apply a patch to your repository
-
→
to add the file to a .gitignore file
-
History
view.
→
to display the selection the
If you select a project in Eclipse you can use additional team operations from the context menu.
-
→
to pull in changes from your remote Git repository
-
→
to fetch the current state of your remote tracking branch
-
→
to switch or create new branches
-
→
to push changes to your remote Git repository
-
→
to create and manage tags.
EGit supports merging of branches to add the changes of one
branch
into another. Select your project
and
→
to start the merge dialog.
If you pull in
changes or merge a branch and you have
conflicting changes, EGit will
highlight the affected files. EGit also
supports the resolution of these merge conflicts.
Right-click on a file with merge conflicts and select → .
This opens a dialog, asking you which merge mode you would like to use. The easiest way to see the conflicting changes is to use the Use HEAD (the last local version) of conflicting files as merge mode. This way you see the original changes on the left side and the conflicting changes on the right side.
You can manually edit the text on the left side or use the Copy current change from right to left button to copy the conflicting changes from right to left.
Once you have manually merged the changes, select → from the context menu of the resource to mark the conflicts as resolved and commit the merge resolution via → .
Right-click on a file with merge conflicts and select → .
This opens a dialog, asking you which merge mode you would like to use. The easiest way to see the conflicting changes is to use the Use HEAD (the last local version) of conflicting files as merge mode. This way you see the original changes on the left side and the conflicting changes on the right side.
You can manually edit the text on the left side or use the Copy current change from right to left button to copy the conflicting changes from right to left.
Once you have manually merged the changes, select → from the context menu of the resource to mark the conflicts as resolved and commit the merge resolution via → .
Git amend allows to adjust the last commit. For example you can
change the commit message. The Git Staging view allows you to perform
the
Git amend command via the highlighted button in the following
screenshot.
Không có nhận xét nào:
Đăng nhận xét