Showing posts with label git. Show all posts
Showing posts with label git. Show all posts

Sunday, July 24, 2016

Import Project from Bitbucket to Eclipse

how to import project to eclipse (by clone),
when you already have project repository on bitbucket


1. File -> Import -> Git -> Project from Git


2. select URI


3. get URI from bitbucket


4. ctrl+v


5. select branches


6. select local directory


7. choose option you want (choose second in my case)



8. following steps are like 'Create Java Project'


9. restart eclipse, check repository and branches


10. right click on project -> Team -> Commit
- select changed files and drag&drop like direction
- summary or memo on commit message
- click 'Commit and Push'


11. OK







Tuesday, July 19, 2016

Create Bitbucket Repository and Connect Eclipse

Ubuntu 14.04
Eclipse Mars 4.5.2


1. join bitbucket and create repository
- dashboard -> repositories -> create repository


- create (can create private repositories only five)



2. install git plug-in on eclipse
- Help -> Install New Software
- fill in ' Work with: http://download.eclipse.org/egit/updates ' or just hit 'git'
- check the box 'Eclipse Git Team Provider'


- next -> next -> I accept  the terms of license agreement -> finish (take few minute.....)
- restart eclipse and can see in import menu


3. create project and connect with bitbucket
- create project and right click on it
- Team -> Share Project


- check 'Use or create repository in parent folder of project'
- choose project you want (already existed....)


- if you can not check, click 'Create Repository' and choose again


4. commit and push
- right click on project -> Team -> Commit
- select and move source files from 'unstaged changes' to 'staged changes'
- commit message is optional


- commit, maybe get error
- right click on project -> Team -> Push Branch 'master'


- fill clone url in ' Location -> URI : ', get from bitbucket


- hit user and password -> next


- next -> finish



- refresh dashboard of bitbucket
- can find commits




ref : http://embedded.kookmin.ac.kr/lectureMobile/index.php/Eclipse_%2B_Github_%EC%82%AC%EC%9A%A9%EB%B2%95


Monday, July 18, 2016

Install Git on Ubintu

2 ways are installing git on ubuntu

A. Installation
1. Using apt-get - it's simple, but not latest version.
$ sudo apt-get install git

2. Download and install manually - it can use latest version.
- install libraries
$ sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext \
    libz-dev libssl-dev
- if you want various documents format, need to these libraries
$ sudo apt-get install asciidoc xmlto docbook2x
- download latest release version from follows
Kernel.org( https://www.kernel.org/pub/software/scm/git/ )
GitHub mirror( https://github.com/git/git/releases )
- compile and install
$ tar -zxf git-1.9.1.tar.gz
$ cd git-1.9.1
$ make configure
$ ./configure --prefix=/usr
$ make all doc info
$ sudo make install install-doc install-html install-info


B. Configuration setting
- user
$ git config --global user.name "user name"
$ git config --global user.email emailaddress@email.com
- editor
$ git config --global core.editor editorname
- checking config settings
$ git config --list
- usage help
$ git help 
$ git  --help
$ man git-
ex) $ git help config


C. Generate project
- generate folder
$ mkdir testGitProject
- generate git repository in above folder
$ git init
- add and commit
$ git add *.c
$ git add LICENSE
$ git commit -m 'message about this project version'


D. Clone remote repository
- follow command makes directory named "libgit2" and generate .git in "libgit2". And clone repository
$ git clone https://github.com/libgit2/libgit2
- only differ name of directory "mylibgit", others are same
$ git clone https://github.com/libgit2/libgit2 mylibgit


E. other commands
- check state of repository
$ git status
- commit
$ git commit
- view log
$ git log
- fetch or pull remote repository (pull = fetch + merge)
$ git fetch [remote-name]
$ git pull [remote-name]
- push
$ git push origin master


ref : https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
ref : http://yokang90.tistory.com/47