Thursday, 29 March 2018


Git is Distributed version Control system

Standard Git  Practices
1)master Branch
3)Different Environments DEV ,IT ,UAT ,Prod. 
4) Jenkins for Continuous Integration and Deployment . 

Here is stand practice for Git

2)we can Fork the masterBranch then we get the ForkedMasterBranch .it will create a copy of master Branch
3)on that ForkedMasterBranch for each enhancement we will create a feature Branch by each developer .we will commit the changes to the feature Branch and do the pull request  to commit the changes to forkedMasterBranch .

Pullrequest means the latest code in the ForkedMaster Branch we will get and merge the feature Branch after Peer review .Means once the developer commit his changes on his feature Branch .we will raise the pull request and assigh the reviewers .then that guy will get the mail that some one made pull request .so that guy will open it and merge the code by resolving the confilcts if any .

Now the code is @ForkedMasterBranch .From this we can test the code in DEV,IT,UAT using Jenkins .

For Prod Environment we need to deploy  the code from master Branch through Jenkins .so we have to commit the code From ForkedMasterBranch to master Branch by doing pull request as earlier .Here only few will have the permissions to  commit the code into master Branch  like Leads .so Lead will we the responsible person to commit the code into master Branch .

Check out the Project from Git

Eclipse>>Project Explorer>>Import>>Import>>Projects from Git>>Clone URI>>Give the URI username/password
select the Branch you what to check out>>select the Work Space you what check out
Select the Radio Button "Import existing Eclipse Projects"
Click on Finish
To see which line Committed in git by whom in Eclipse
Select/Open a file>>Right click>> Team>>show Revision information

How to Commit the Files into Git from Eclipse

1)Get the Backup of the Files
2)Right click on the Project >>Team >>Pull>> give Username and Password
a)  if no conflicts it will put all the Files from Repository-now we can commit the Files which wills show all out going changes
b) if you got the Conflicts
In this case we have to delete the Conflict files and then Pull again
Now we don't have conflict files only remote files.
Now we can merge you changes manually into that Project
3)Before Committing you changes pull again. Because while you are merging someone may commit so thing this may leads to conflicts again
so, better to pull after you merge your changes
4)Now Drag and Drop you changes to Index/staging and give the Commit Comment. now you have 2 options
push and push and Commit
push and Commit: if you click on this button then your changes will be committed in that particular remote Branch
push: if click on the push, then you changes will be There in the staging not in the remote Branch.
so, you can go to the Browser and do the pull request and assign a reviewer of your code.
Then the changes will be verified by that reviewer. if he gives and comments you can fix that and then
the reviewer will merge you changes into remote Branch

No comments:

Post a Comment