This document provides an overview of using Eclipse EGit to manage code changes across remote repositories. It discusses pulling code changes from and pushing changes to remote repositories. It also covers committing new files and resolving merge conflicts that can occur when changes are made to the same file from different locations. Examples are given of committing and pushing changes from one machine and then pulling them to another machine. It also outlines the process for accepting single file changes from a remote repository.
1 of 11
Download to read offline
More Related Content
Eclipse e git
1. Eclipse EGit
Project Explorer > Right click > Context Menu
Pull code changes from
remote repository
Push code change to
remote repository
No need to use this option
It will launch merge tool.
Auto merge the code
changes
To commit new file
4. Eclipse EGit
Adding New File
main.css > Right click > Team > Add to
Index
main.css > Right click > Team > Commit >
Stagin Window > Enter Comment > [Commit
and Push]
? Icon
+ Icon
User Machine 1 User Machine 2
Project > Right click > Team > Pull
> Icon
Note :
5. Eclipse EGit
User Machine 1 User Machine 2
Case I: Commit, Push and Pull
Updating index.html file Updating main.css file
[Commit and Push] > Sucess
[Commit and Push] > It will show error.
Here main.css committed successfully in local
repository but failed to push
Right click > Project > Team > Pull
Right click > Project > Team > Push Upstream
Right click > Project > Pull
Both the machines are updated due to Pull action
6. Eclipse EGit
User Machine 1 User Machine 2
Case II: Commit, Push and Pull
Updating index.html file in line #3 Updating index.html file in line #2
[Commit and Push] > Success
[Commit and Push] > Rejected
Step 1 : Project > Right click > Team > Pull
Step 2 : index.html > Right click > Team >
Merge Tool
Step 3 : Move Line#3 change from Right to Left
Step 4 : index.html > Right click > Team > Add
to Index
Step 5: [Commit and Push] > Success
Right click > Project > Pull
With out performing
Commit to local
Repository we cant
trigger Pull Request
due to conflicts
7. Eclipse EGit
User Machine 1 User Machine 2
Case III: Commit, Push and Pull
Updating index.html file in line #2 and adding
few team members
[Commit and Push] > Success
Updating index.html file in line #2
index.html > Right click > Team > Commit >
clicking [Commit] button.
It will not throw any errors. It will commit to
local repository.
8. Eclipse EGit
User Machine 2
Case III: Commit, Push and Pull (Cont..)
Step 2 : index.html > Right click > Team >
Merge Tool
Step 1 : Project > Right click > Team > Pull
9. Eclipse EGit
User Machine 1 User Machine 2
Case III: Commit, Push and Pull (Cont..)
Step 4 : index.html > Right click > Team > Add
to Index
Step 5: [Commit and Push] > Success
Right click > Project > Pull
10. Eclipse EGit
To accept single file changes
Step 1: Project > Right click > Team > Fetch
from Upstream
Step 2: File > Right click > Compare with >
Branch, Tag or Reference
Step3: In Compare Dialog > Select Remote
Tracking > Eg: origin/mater > [Compare]
button
Step4: We can move changes from Right to
Left (Local)