Here is an example of my local project, "Test", to add the project to GitHub version control.
1. Select "Test", right-click Team>Share Project ...
2. Select Git in the new window and next>
3. Create a local git Repository
Select Create ...,
4. Select a folder
My choice is C:\Users\lu\git\test,
Click Finish to return to the previous page. Click Finish in 3. The local repository is created.
5. Submit your Code
Select items, right >Team>Commit ...
6. Fill in the comments
File All selected
Select Commit or commit and Push
One sentence summarizes the difference between the two: commit is saved locally, and push is the real commit to the server.
Best practice: Commit once every time you add or modify a small function. This function is not too big, in the future to check the problem more clearly. If the changes are large, you can break these changes into a few minor changes, and then commit, a commit is responsible for a part of the change, when these commits are completed and then push. No push-up commits are saved locally and can be modified.
Select Commit first.
If you want to put the project on the server, need to have a server-side repository, step 7~9, is the process of creating a server-side repository. If you already have one, you can jump straight to the 10th step.
7. Login to GitHub profile, select Repository tab, select New
8. Enter Repository name:test, select Create Repository
9. Copy Address
Click HTTP, copy Https://github.com/isiwnlg/test.git
10. Select Project, right >Team>Push Branch ...
One by one . fill in the server repository URI and login information, and click next>
(Note: In the 6th step, if you choose Commit and Push, the following interface will also pop up)
12. Select refs to pushin the drop-down list.
If before eclipse has used GitHub, the previous interface will not pop up and will pop up directly
13. Confirm the push message and click Finish.
Complete.
Subsequent articles will continue to explain the specific effects of the context menu.
Using GitHub in Eclipse Luna