Why GitHub ?
Github is basically a version control system same as SVN (SubVersion) or CVS to maintain your code in the web UI. Very popular openSource component to keep our code. It has 2 feature Public or Private. Public projects will be viewed by anyone. You will find most of the openSource code published in GitHub. You can integrate gitHub easily with standard editors "Eclipse, Netbeans, IntelliJ.."
Latest Eclipse (Luno) release comes with GitHub plugin as in-build. You can checkout your source and check-in easily.
GitHub in Command Line In Interface on Ubuntu
$ sudo apt-get install gitHow to Checkout from Git?
$ git clone https://github.com// .git
How to Check status on your directory with git master ?
$ cd ~/$ git status -u origin master
Pull your changes from GitHub
$ cd ~/$ git pull -u origin master
Push your changes into GitHub
$ git addAdd your existing project into Git$ git commit -m "Adding into Git" $ git push -u origin master
Login to your gitHub in web UI
Create a Repository in your github UI
Push project from Terminal into your created Git Repository
$ cd ~/$ git init $ git add $ git commit -m "Adding projects into git" . $ git remote add origin https://github.com/username/projectName.git $ git pull -u origin master $ git push -u origin master
Check out GitHub project repository into Eclipse
- Open Eclipse with workspace
- Go to Window > Open Perspective > Other > Git > Ok
- Right click and select 'Paste Respository Path or URI'
- Copy and paste the Git URI from Git Web UI > HTTPS Clone URL
- Move on with Next and finish to checkout repository into your workspace
- Select Git Repository > Right Click 'Import Project' > Select your project into working directory > Finish
- Select your project > right click > Properties > Project Facets > Click 'Convert to faceted form..'
- Select 'Java' and 'Version' change in dropdown if you have multiple version
- Click 'Apply' > Ok
- Select your project > right Click > Source Folder > FolderName 'src/main/java' > Finish
- Select your project > right Click > Source Folder > FolderName 'src/main/test' > Finish
- Open Eclipse with Workspace had checkout project from git.
- Select your project > right Click > Team > Add To Index (Need to add first)
- Select your project > right Click > Team > Commit > provide commit message > commit and push > ok
- Open Eclipse with Workspace had checkout project from git.
- Select your project > right Click > Team > Pull
Note : You can do synchronize with Repository through Team > Synchronize Workspace to sync and verify the pull or push changes before you do.
Try : Familiar yourself with Git in 5 mins
No comments :
Post a Comment