Hello World from OSS Silicon Valley


HowToUse/Git/1.7


_ Install&Setup

_ Install Git from Cygwin

(TBD)

_ HowToUse

_ Use original Git Server

_ Setup the Git Server

Refer HowToUse/Git Daemon/1.7

_ Create Repository

Step.1
Create your local repository.
# mkdir <Local Repository>
# cd <Local Repository>
# git init
# git remote add origin <User Name>@<Host name>:<Repository Path>

(Example)

# git remote add origin syatsuzuka@192.168.56.101:/home/syatsuzuka/repo/test.git
Step.2
Check in the first file.
# touch readme.txt
# git add readme.txt
# git commit -m 'Initial commit'
# git push -u origin master

_ Use GitHub

_ Sign up the GitHub

Step.1
Access the GitHub web site and sign up(https://github.com/).
GitHub_fig1.png
GitHub_fig2.png
Step.2
Click "create" button and create new repository.
GitHub_fig3.png
GitHub_fig4.png

_ Create Repository

Step.1
Create your local repository.
# mkdir <Local Repository>
# cd <Locak Repository>
# git init
# git remote add origin https://<User Name>@github.com/<User Name>/<Repository Name>.git

(Example)

# git remote add origin https://github.com/syatsuzuka/test.git
Step.2
Check in the first file.
# touch readme.txt
# git add readme.txt
# git commit -m 'Initial commit'
# git push -u origin master
GitHub_fig5.png

_ Use BitBucket

_ Sign up the BitBucket

Step.1
Access the BitBucket web site and sign up(https://bitbucket.org/).
BitBucket_fig1.png
BitBucket_fig2.png
Step.2
Click "create" button and create new repository.
BitBucket_fig3.png
BitBucket_fig4.png

_ Create Repository

Step.1
Create your local repository.
# mkdir <Local Repository>
# cd <Locak Repository>
# git init
# git remote add origin https://<User Name>@bitbucket.org/<User Name>/<Repository Name>.git

(Example)

# git remote add origin https://syatsuzuka@bitbucket.org/syatsuzuka/test.git
Step.2
Check in the first file.
# touch readme.txt
# git add readme.txt
# git commit -m 'Initial commit'
# git push -u origin master
BitBucket_fig5.png

_ Maintain the files in remote Repository

Step.1
Clone the remote repository.
# git clone <Repository Path>

(Example)

# git clone https://syatsuzuka@bitbucket.org/syatsuzuka/test.git
Step.2
Launch Eclipse and switch to Git Perspective.
MaintainFiles_fig1.png
Step.3
Click "Add an existing local Git repository" and setup Local Repository Path.
MaintainFiles_fig2.png
MaintainFiles_fig3.png
Step.4
Edit the files.
Step.5
Commit and push the modified files. Eclipse Plugin sometimes doesn't have full functionalities for the external utilities such as maven or git, so I recommend you to use command line for fundamental operations except for editing files.
# git add <Modified Files>
# git commit -m '<Commit Log>'
# git tag -a <version> -m '<description>'
# git pull origin
# git push origin

_ Further Operation

_ Maintain submodule

Step.1
Get submodule in the workspace.
# git submodule <repository path> <submodule directory>

Then you can include submodules to your project without maintaining version control for its submodule code.

_ Author

S.Yatsuzuka