What is GIT?
GIT is a distributed version control system which is open source. It is mainly used to maintain code and view change history. With GIT you can obtain any version of any file
GitHub is a website to upload your repository. It is very convenient and it provides backup on cloud. It makes Collaboration easier and helps in collaborating in a team
Git Workflow
A high level Git workflow is as under
Working Copy -> Staging Area -> Local Repository -> Remote repository
When you give the Add command in Git, your file goes from the working copy to the Staging area. Next when you give the command commit, your changes are commited on your local repository and finally when you say Push, your changes will appear on the remote repository.
When you use Eclipse, everything is made simple for you. Follow the steps below and you will get started with using GIT and GitHub
Create Repository on www.github.com
1) Create a remote Repository on GitHub
2) Copy the path that appears
Procedure to Push
Push is required to make your code available on the remote repository
3) In Eclipse, right click Project and click Team->Share Project->Select Git->Click Next
4) Click on the project in 'Configure Git Repository' dialog' and click Create Repository
button. Click Finish
5) Right click Project and click Team->Commit. Select Required Files in 'Commit Changes'. Enter
'Commit Message' and click on Commit.
6) Right click Project and click Team->Repositories view
7) Right click on Remotes->click Create Remote
8) Click OK on the 'New Remote' popup that appears
9) Put the path in URL and provide UserName and Password
10) Click Finish
11) Click Save and Push on 'Configure Push' dialog. Give username and password and click ok. On
'Push Results' dialog click Ok.
12) Verify creation of master branch under Branches->Local in Repositories view
13) Refresh the website and verify contents
----End of Push----
Procedure to Pull
14) Click on Origin in Remote Repository
15) Right click on Pull and click Configure Fetch
16) Click on Add in 'Configure Fetch' dialog
17) Select Source as master. Click Next and Finish.
18) Click Save and Fetch and click OK
----End of Pull----
Configure Master Branch
19) Right click on Local->Master
20) Click Configure Branch
21) Select Remote=Origin and Upstream Branch as 'refs/heads/master'. Click Ok.
----End of Master Configuration
Incorporate Changes
22) Change a file
23) Right click project and Select Team->Commit. Enter Comments. Click Commit button.
24) Check the code online. The changes are not reflected.
25) Right click project and click on Team->Push to upstream.
26) Enter username and password and click ok
27) Click Ok on 'Push Results' dialog.
28) Check that the code changes get reflected online.
----End of Updates----
GIT is a distributed version control system which is open source. It is mainly used to maintain code and view change history. With GIT you can obtain any version of any file
GitHub is a website to upload your repository. It is very convenient and it provides backup on cloud. It makes Collaboration easier and helps in collaborating in a team
Git Workflow
A high level Git workflow is as under
Working Copy -> Staging Area -> Local Repository -> Remote repository
When you give the Add command in Git, your file goes from the working copy to the Staging area. Next when you give the command commit, your changes are commited on your local repository and finally when you say Push, your changes will appear on the remote repository.
When you use Eclipse, everything is made simple for you. Follow the steps below and you will get started with using GIT and GitHub
Create Repository on www.github.com
1) Create a remote Repository on GitHub
2) Copy the path that appears
Procedure to Push
Push is required to make your code available on the remote repository
3) In Eclipse, right click Project and click Team->Share Project->Select Git->Click Next
4) Click on the project in 'Configure Git Repository' dialog' and click Create Repository
button. Click Finish
5) Right click Project and click Team->Commit. Select Required Files in 'Commit Changes'. Enter
'Commit Message' and click on Commit.
6) Right click Project and click Team->Repositories view
7) Right click on Remotes->click Create Remote
8) Click OK on the 'New Remote' popup that appears
9) Put the path in URL and provide UserName and Password
10) Click Finish
11) Click Save and Push on 'Configure Push' dialog. Give username and password and click ok. On
'Push Results' dialog click Ok.
12) Verify creation of master branch under Branches->Local in Repositories view
13) Refresh the website and verify contents
----End of Push----
Procedure to Pull
14) Click on Origin in Remote Repository
15) Right click on Pull and click Configure Fetch
16) Click on Add in 'Configure Fetch' dialog
17) Select Source as master. Click Next and Finish.
18) Click Save and Fetch and click OK
----End of Pull----
Configure Master Branch
19) Right click on Local->Master
20) Click Configure Branch
21) Select Remote=Origin and Upstream Branch as 'refs/heads/master'. Click Ok.
----End of Master Configuration
Incorporate Changes
22) Change a file
23) Right click project and Select Team->Commit. Enter Comments. Click Commit button.
24) Check the code online. The changes are not reflected.
25) Right click project and click on Team->Push to upstream.
26) Enter username and password and click ok
27) Click Ok on 'Push Results' dialog.
28) Check that the code changes get reflected online.
----End of Updates----
No comments:
Post a Comment