SlideShare a Scribd company logo
1 of 140
Introduction to Github with Egit
2014
/YuMatsuzawa/
Github??
• Google it, now.
• Or, https://github.com/
Introduction to Github 2
Github??
Introduction to Github 3
Github??
Introduction to Github 4
Make your account,
now.
Github??
Introduction to Github 5
Make your account,
now.
Or, Login if already got one.
You will see…
Introduction to Github 6
You will see…
Introduction to Github 7
…then you are ready.
LOLWATTZDIS?
• With Github, you can…
– Find/Clone/Help someone else’s nice projects.
– Sync your progress across multiple machines.
– Roll back your project to previous state.
– Publish/Share your project.
• “Git” is one of many Version Control Systems (VCS).
• Github is one of public platforms (hubs) of Git.
Introduction to Github 8
LOLWATSDIS?
• With Github, you can…
– Find/Clone/Help someone else’s nice projects.
– Sync your progress across multiple machines.
– Roll back your project to previous state.
– Publish/Share your project.
• “Git” is one of many Version Control Systems (VCS).
• Github is one of public platforms (hubs) of Git.
Introduction to Github 9
• Seems nice, but what is ‘cloning’?
 Cloning a project is basically copying it to
your machine/environment to extend it
as you like.
 You can clone any public projects
including very famous one such as jQuery
(/jQuery/jQuery)
• How to help someone?
 Clone their project, modify, and offer
your help as ‘pull request’ (covered later)
LOLWATSDIS?
• With Github, you can…
– Find/Clone/Help someone else’s nice projects.
– Sync your progress across multiple machines.
– Roll back your project to previous state.
– Publish/Share your project.
• “Git” is one of many Version Control Systems (VCS).
• Github is one of public platforms (hubs) of Git.
Introduction to Github 10
• Thanks a bunch! But how?
 Covered later in detail; in a few words:
1. Uploading your progress to Github
2. Downloading it to other machines
3. (Conflict shall be checked/marked)
• Is it automatic?
 NO. Why? Covered later.
LOLWATSDIS?
• With Github, you can…
– Find/Clone/Help someone else’s nice projects.
– Sync your progress across multiple machines.
– Roll back your project to previous state.
– Publish/Share your project.
• “Git” is one of many Version Control Systems (VCS).
• Github is one of public platforms (hubs) of Git.
Introduction to Github 11
• Why this is important?
 When you mess up with your project and
it stops working (happens often), you can
come back to the point it had worked.
• To any states before? Any limit?
 No limitation. Github doesn’t have “max
space.” You’ll see why.
LOLWATSDIS?
• With Github, you can…
– Find/Clone/Help someone else’s nice projects.
– Sync your progress across multiple machines.
– Roll back your project to previous state.
– Publish/Share your project.
• “Git” is one of many Version Control Systems (VCS).
• Github is one of public platforms (hubs) of Git.
Introduction to Github 12
• Could be useful… but can I keep it private?
 NO. This is why github is free AND space-
unlimited. Projects uploaded on github is
considered public assets(or Open Source
Software) thus forcibly published.
• Really?
 …Unless you pay at least $7/month.
Now you know Github is
• Platform of distributed development for
Open Source Software using Git
– Actually, not limited to software. Any contents can
be managed on github (images, .doc, .xls, etc.)
– You must acknowledge contents on Github is
published, thus you shouldn’t upload restricted
contents (such as data including private info.)
– Let’s delve into “How”
Introduction to Github 13
From Where?
• Basic Git is CUI thing
– You may learn/use Git this way, and actually, sometimes, for
some kind of people, it’s even easier. But for now…
• Let’s do this from Eclipse GUI (for Java users)
Introduction to Github 14
Requirement
• Any working Eclipse (not too old one)
• ssh-keygen
– Included in recent versions of Eclipse
– Other ways:
• On Mac/Linux this is innately installed
• On Windows:
– If you have cygwin installed, you’re OK.
– If you have PuTTY or TeraTerm installed, you’re OK.
– Otherwise, install TeraTerm.
» PuTTY and TeraTerm are both terminal emulator. For
OpenSSH keygen purpose, TeraTerm is simpler and easier.
Introduction to Github 15
EGit
• … is Eclipse plugin for Git.
• Install it.
1. Launch Eclipse
2. Help > Eclipse Marketplace
3. Search “EGit”
4. Install
Introduction to Github 16
Prepare SSH public key
• Stay in Eclipse
• Open “設定”(Preferences)
– “一般”(General)>”ネットワーク接続”(Network
Connection)>”SSH2”
– “鍵管理”(Key Management)
– “RSA鍵の生成”(Generate RSA Key)
– “秘密鍵の保管”(Save Private Key)
• Default name would be “id_rsa”
• Path should be <user>/.ssh/
Introduction to Github 17
Prepare SSH public key
• If you already got one, new key isn’t required
– Found “<user>/.ssh/id_rsa.pub” ? => Done.
• On Mac/Linux or Cygwin:
– Launch Terminal or Cygwin
– Type “ssh-keygen”
• Save/Move your key under <user>/.ssh/
• On TeraTerm:
– Cancel “新しい接続”
– “設定” > “SSH鍵生成”
• Save under <user>/.ssh/
Introduction to Github 18
Prepare SSH public key
• On PuTTY:
– Find PuTTYGen in PuTTY install directory
– “生成”(Generate)
– (Move cursor around)
– “変換”(Convert)
>“OpenSSH形式”
• This is for private key
– Save as appropriate name
• Default: <user>/.ssh/id_rsa
• No extension needed
Introduction to Github 19
Prepare SSH public key
– Copy this
• PuTTYGen generate original format ssh key
• OpenSSH format key required
• This is for pubic key
– Open text editor
– Paste
– Save as appropriate name
• Default: “id_rsa.pub”
Introduction to Github 20
Register public key
Introduction to Github 21
Register public key
Introduction to Github 22
Register public key
Introduction to Github 23
Register public key
Introduction to Github 24
Register public key
Introduction to Github 25
Register public key
Introduction to Github 26
Register public key
Introduction to Github 27
Register public key
Introduction to Github 28
Paste the content of generated id_rsa.pub here
Appropriate title
Specify SSH private key for Eclipse
• Generated your key via Eclipse? => Done.
• If not:
– Your key is <user>/.ssh/id_rsa? => Done.
– If not:
• Open “設定”
• “一般”>”ネットワーク接続”>”SSH2”
• “秘密鍵の追加”(Add Private Key)
• Specify your key name
– Make sure it’s stored under <user>/.ssh/
Introduction to Github 29
Authentication Method
• “認証方法”(Authentication Methods)
• Uncheck “password”
– Only key authentication
• Now everything ready!
Introduction to Github 30
Create Repository
• What’s “repository”?
– Storage for Git objects
– There must be remote repository on Github AND
local repository on your machine
– Concept: Transactions are done between
repositories (specific locations)
Introduction to Github 31
Create Remote Repository
Introduction to Github 32
Create Remote Repository
Introduction to Github 33
Create Remote Repository
Introduction to Github 34
Create Remote Repository
Introduction to Github 35
Appropriate title
Description
Cannot choose Private
on unpaid account
Make README
Create Remote Repository
Introduction to Github 36
Done.
Share your existing project
• Open your project
• Right click
• チーム”Team”
• プロジェクトの共用
“Share the project”
• “Git”
Introduction to Github 37
Create Local Repository
Introduction to Github 38
Create Local Repository
• Where to reposit?
– Recommended: Distinct, new path dedicated only for
that repository outside of Eclipse workspace
• Not the same as the already existing project directory
(usually in Eclipse workspace)
• Why? -> Several reasons. Primarily for future use when you
would want to place multiple projects in that repo.
• Faster (Git only cares about files inside the repo)
– Easier to understand: Project directory
• No need to move files (easier to initialize)
• Sometimes slower (Git starts to check files in workspace)
Introduction to Github 39
Create Local Repository
• Where to reposit?
– Recommended: Distinct, new path dedicated only for
that repository outside of Eclipse workspace
• Not the same as the already existing project directory
(usually in Eclipse workspace)
• Why? -> Several reasons. Primarily for future use when you
would want to place multiple projects in that repo.
• Faster (Git only cares about files inside the repo)
– Easier to understand/start: Project directory
• No need to move files (easier to initialize)
• Sometimes slower (Git starts to check files in workspace)
Introduction to Github 40
…If you are certain about 1 project <-> 1 repo philosophy
Go to
Create Local Repository
Introduction to Github 41
Create Local Repository
Introduction to Github 42
Create Local Repository
Introduction to Github 43
Create Local Repository
Introduction to Github 44
Aforementioned recommendation
Ignore warning and create repo
Create Local Repository
• If you are to place your repo outside of Eclipse
workspace…
Introduction to Github 45
Create Local Repository
• If you are to place your repo outside of Eclipse
workspace…
Introduction to Github 46
Default path would be /<user>/git/
After proceeding, project migration to new
path will begin.
Introduction to Github 47
Repository Ready
Introduction to Github 48
Repository Ready
Open Git repositories pane.
ウィンドウ>ビューの表示>その他>チーム
Indicators appeared
(‘>’,’?’,’[NO-HEAD]’,…)
A little backtracking
• It’s good time to learn how exactly Git works.
Introduction to Github 49
A little backtracking
• It’s good time to learn how exactly Git works.
Introduction to Github 50
GithubYour Machine
Your Eclipse
A little backtracking
• You’ve created repositories.
Introduction to Github 51
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
A little backtracking
• Obviously, you want to store your project.
• …but making repository is just
a first step.
Introduction to Github 52
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
A little backtracking
• Inside repos are indexes (file lists)
• Indexes track what files belong
to the repos
Introduction to Github 53
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-…
-…
-…
Index
-…
-…
-…
A little backtracking
• Inside repos are indexes (file lists)
• Indexes track what files belong
to the repos
• You can ‘git add’ to the index
Introduction to Github 54
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
‘git add’!!
Added!
A little backtracking
• Now the local repo knows your files
• But only their existence.
• Repo must know if files are
ready to be shared/launched
Introduction to Github 55
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
A little backtracking
• Your next move is to register your progress
•
•
Introduction to Github 56
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
A little backtracking
• Your next move is to register your progress.
• ‘git commit’ is the way to go.
• Records your current progress
on indexed files to the repo.
Introduction to Github 57
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
‘git commit’!!
A little backtracking
• You commit to a specific “branch”
• Branch = Front-ends of devel.
flows (latest commits)
First commit creates ‘master’
Introduction to Github 58
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
c00
master
Created!
A little backtracking
• If you modify your files and commit again,
•
Introduction to Github 59
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
‘git commit’!!
master
c00
A little backtracking
• If you modify your files and commit again,
• …that records are committed
to currently targeted branch
(in this case ‘master’).
New one becomes branch.
Introduction to Github 60
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
master
c00 c01
A little backtracking
• You can make another branch
•
Introduction to Github 61
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
master
c00 c01 c02 c03
another
A little backtracking
• You can make another branch
• Committing to another branch
will separate the flow.
Introduction to Github 62
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
master
c00 c01 c02 c03
a01a00
another
A little backtracking
• You can make another branch
• Committing to another branch
will separate the flow.
• Also you can merge them.
Introduction to Github 63
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
master
c00 c01 c02 c03
a01a00
m00
A little backtracking
• If branches conflict (like edited same file),
•
Introduction to Github 64
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
master
c00 c01 c02 c03
a01a00
another
A little backtracking
• If branches conflict (like edited same file),
• …Git notifies conflicting files.
Introduction to Github 65
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
master
c00 c01 c02 c03
a01a00
another
A little backtracking
• If branches conflict (like edited same file),
• …Git notifies conflicting files.
• Then you must manually fix
conflicts then add again.
Introduction to Github 66
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
master
c00 c01 c02 c03
a01a00
another
Fix & ‘git add’!!
A little backtracking
• If branches conflict (like edited same file),
• …Git notifies conflicting files.
• Then you must manually fix
conflicts then add again.
Introduction to Github 67
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
master
c00 c01 c02 c03
a01a00
m00
A little backtracking
• Anyway, let’s go committing for now!
• Back to Eclipse…
Introduction to Github 68
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
c00
master
Created!
Introduction to Github 69
Add/Commit
Indicators appeared
(‘>’,’?’,’[NO-HEAD]’,…)
Introduction to Github 70
Add/Commit
These indicator means:
> -Uncommitted changes exists
? -Not added to the index
* -Added but uncommitted (‘staged’)
[<branch name>] -Current branch**
**Pointer/cursor to current branch is called
‘HEAD’. ‘NO-HEAD’ means no branch specified.
Indicators appeared
(‘>’,’?’,’[NO-HEAD]’,…)
Introduction to Github 71
Add/Commit
• Right click on the project,
• “チーム”(Team),
• You’ll find its contents changed
• “コミット”(Commit)
• (You can do the same thing by right-clicking
the repository from the repositories pane.)
Introduction to Github 72
Add/Commit
• (This window can differ from an Eclipse
version to another, this is Juno 4.2.2)
• Commit Message is important feature used
for explaining what changes are made.
• Keep it simple but understandable
• If there are untracked files, you can add
them here. (Check this “Show untracked”)
Hit “Commit” if messages/adding
files are ready
Add/Commit
• Gratz! Your first LOCAL commit
(+ add) is made.
• You notice the ‘>’ indicator
disappeared from the project.
– This means the local repository
now stored your progress.
Introduction to Github 73
“Remote Control”
• Next step is to interact with the remote repo.
•
Introduction to Github 74
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
c00
master
Created!
“Remote Control”
• Next step is to interact with the remote repo.
• Remote contents are managed
with similar branch system.
• On repo creation, remote
‘master’ was also made.
Introduction to Github 75
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
c00
master
r00
master
“Remote Control”
• Now, you need special local branch.
•
Introduction to Github 76
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-… r00
masterc00
master
“Remote Control”
• Now, you need special local branch.
• So-called “remote tracking”
• This branch tracks/syncs with
status of remote branch.
Introduction to Github 77
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-… r00
master
r00
origin/master
c00
master
“Remote Control”
• ‘origin’ means it’s your primary remote repo.
• ‘origin/master’ means it syncs
with ‘master’ branch on your
remote repo.
Introduction to Github 78
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-… r00
master
r00
origin/master
*These are just a common tactics to
name a remote tracker. You may
name yours as you want.
c00
master
“Remote Control”
• Tracker will ‘git fetch’ the remote contents.
• The first fetch creates the
remote tracker.
Introduction to Github 79
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-… r00
master
r00
origin/master
Created!
‘git fetch’!!
c00
master
“Remote Control”
• Then you merge 2 local branches.
•
Introduction to Github 80
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
c00
master
r00
master
r00
origin/master
“Remote Control”
• Then you merge 2 local branches.
• Now local ‘master’ contains all
contents from local & remote.
Introduction to Github 81
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
c00
master
r00
master
r00
origin/master
m00
*In distributed developments, conflicts can happen on this phase.
**If you followed this instruction, local ‘master’ contains your local
project and initially created README from remote at this moment.
“Remote Control”
• With fetch & merge, local branch is up-to-date
• Normally you do this before
starting your work of the day.
• You may just ‘git pull’ here.
Introduction to Github 82
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
c00
master
r00
master
r00
origin/master
m00
*Pull basically means ‘fetch then merge’ combined.
“Remote Control”
• Next move obviously, is going opposite way
•
Introduction to Github 83
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
c00
master
r00
master
r00
origin/master
m00
“Remote Control”
• Next move obviously, is going opposite way
• At this point all tools are set.
• ‘git push’ will do the trick.
Introduction to Github 84
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
c00
master
r00
master
r00
origin/master
m00
*Push will commit to the remote tracker, then sync it to the
branch on the remote by uploading/overwriting contents.
**Again, conflicts can happen here, and your push sometimes
‘rejected’ by the remote. If so, you need to fetch & merge.
r01
‘git push’!!
r01
“Remote Control”
• So, in summary:
• Pull (fetch & merge). Remote
tracker created. (Do work.)
Push. Done. Let’s do this ->
Introduction to Github 85
Github
Your Eclipse
Remote RepositoryLocal Repository
Your Machine
Index
-File1
-File2
-…
Index
-…
-…
-…
c00
master
r00
master
r00
origin/master
m00
r01
r01
Remote Configuration
Introduction to Github 86
Back to Web Browsers.
Your Remote Repo page.
Remote Configuration
Introduction to Github 87
Back to Web Browsers.
Your Remote Repo page.
Copy this address.
Make sure its ‘SSH’.
*You registered SSH key, so you can pull/push via SSH connection.
**You can pull via HTTPS, but cannot push.
Remote Configuration
Introduction to Github 88
Remote Configuration
Introduction to Github 89
In the Repo Pane, under the repo
> “リモート”(Remote)
Remote Configuration
Introduction to Github 90
Right click
> “リモートの作成”(Create a remote)
In the Repo Pane, under the repo
> “リモート”(Remote)
Remote Configuration
• Making push configuration first would be a
little easier.
Introduction to Github 91
Push Configuration
Introduction to Github 92
Click this to expand
Push Configuration
Introduction to Github 93
PushConfiguration
Introduction to Github 94
Your copied address should automatically
be inserted from clipboard.
No need to modify username/password.
‘git’ is global username, auth’ed by key
Push Configuration
Introduction to Github 95
Push Configuration
Introduction to Github 96
What was HEAD?
> Reference to current branch.
Click & focus here, then hit Ctrl+Space
Push Configuration
Introduction to Github 97
Complement service will automatically
search existing remote branches.
Choose ‘master’ branch.
Push Configuration
Introduction to Github 98
Checking this has literal meaning.
When pushing, it will ignore push
rejection from the remote branch
and forcibly push the local HEAD.
Generally a bad idea.
Push Configuration
Introduction to Github 99
Push Configuration
Introduction to Github 100
• Repositories Pane should now be like this.
Push Configuration
Introduction to Github 101
• Repositories Pane should now be like this.
• Right click on ‘origin’
• “フェッチの構成”(Configure fetch)
Fetch Configuration
Introduction to Github 102
Fetch Configuration
Introduction to Github 103
Exactly the same as push
Fetch Configuration
Introduction to Github 104
Fetch Configuration
Introduction to Github 105
Again, click & focus here, then hit Ctrl+Space.
Choose ‘master’.
Fetch Configuration
Introduction to Github 106
Another overwrite option.
Better not check.
Fetch Configuration
Introduction to Github 107
Now that fetch configuration is ready,
let’s try fetching for the first time!
Remember, first fetch will create the
remote tracking branch ‘origin/master’
Fetch
Introduction to Github 108
Result should be like this.
Server certification acceptance may be
prompted.
Remote Tracking Branch
• Under “ブランチ”(Branch)
>”リモート・トラッキング”(Remote tracking),
you will find ‘origin/master’
• To reflect the remote status to local…
Introduction to Github 109
Merge
• Right click on the remote tracker
• “マージ”(Merge)
Introduction to Github 110
Merge
• At this time, result should be like this.
• Key is ‘Fast-forward’(FF)
– Basically means no conflicts there.
– To be precise, one branch is wholly older, and its
recent commit is included in the other.
Introduction to Github 111
Merge
• Here comes README from the
remote joining the local.
• Finally, to upload this merged
commit to the remote…
Introduction to Github 112
Push
Introduction to Github 113
2 ways of doing this:
Right click on the project
> “チーム”(Team)
>”アップストリームへプッシュ”
(Push to upstream)
or
Right click on ‘origin’ under “リモート”
>”プッシュ”(Push)
Push
Introduction to Github 114
• Result should be like this.
• At this time no rejection for sure.
Check on Github
Introduction to Github 115
Back to Web Browsers.
Try refresh.
Check on Github
Introduction to Github 116
Happy face 
Easier way for daily use
• Now the very basic git usage is covered.
• May pull / commit and push as shortcut.
Introduction to Github 117
Versioning
• Versioning is done through tagging in git.
• You may noticed “タグ”(Tag) in the repo pane.
• Right click and “タグの作成”(Create a tag)
Introduction to Github 118
Tag
Introduction to Github 119
Hit this to expand
Tag
Introduction to Github 120
Appropriate name (such as v1.0, v2.4-beta)
Description message
Choose a commit you want to tag
Tag
• Now that commits are tagged.
• If you want to publish these tags (versions),
you need to push tags manually.
– Not tied to branch pushing, but the concept is
exactly the same.
Introduction to Github 121
Push Tag
• Right click on the tag > “Push Tag”
• “構成済みレポジトリー”
(Configured Repository)
• Hit Next
Introduction to Github 122
Push Tag
• Tricky part: Tags are referred like
‘refs/tags/<tag name>’.
Introduction to Github 123
Push Tag
• Tricky part: Tags are referred like
‘refs/tags/<tag name>’.
• You need to manually
specify this.
Introduction to Github 124
Target name
Push Tag
• Tricky part: Tags are referred like
‘refs/tags/<tag name>’.
• You need to manually
specify this.
• Basically just copy the
name above.
Introduction to Github 125
Target name (refs/tags/v1.1)
Push Tag
• Result should be like the left
• On Github, ‘releases’ should appear and you
can see the version history
Introduction to Github 126
Versioning
• Versioning itself needs its own philosophy and
practice, and it’s ultimately depends on how
the team will handle the project.
• Make/follow the guideline and decide
when/how often/what kind of state to publish.
Introduction to Github 127
From Remote, Comes…
• So far, we assumed you have your local project
developed without using git.
• And how to integrate it with git is covered.
• Let’s see how to duplicate your git-integrated
project to your extra machines.
• Or to duplicate other’s project.
– These are done with exact same procedure.
Introduction to Github 128
Clone
• You can ‘git clone’ the remote repo itself.
•
Introduction to Github 129
Github
Your Eclipse
Remote Repository
Your Machine
Index
-…
-…
-… r00
master
r01
Clone
• You can ‘git clone’ the remote repo itself.
• And it’s really easy!
• Not only it copies contents of
the repo, it automatically set
all the remote configuration!
Introduction to Github 130
Github
Your Eclipse
Remote Repository
Your Machine
Index
-…
-…
-… r00
master
r01
Local Repository
Index
-File1
-File2
-…
c00
master
r00
origin/master
m00
r01
‘git clone’!!
Created!
Created!
Created!
Created!
Clone
• All you need is…
• Copy.
Introduction to Github 131
This.
Clone
• On your target machine,
• Right click on the blank area of the repo pane.
• “リポジトリー・パスまたはURIの貼り付け”
Introduction to Github 132
Clone
Introduction to Github 133
Same as before.
Clone
Introduction to Github 134
You cannot clone to
non-empty path.
If the repo includes Java project,
you can also import them.
Clone
• With cloning, you can duplicate your Eclipse
project env. on another machine with ease.
– As long as you respect the procedure of
pull/modify/commit/push, you can work on your
project from various places without an issue.
– But sometimes an error will happen. And in a team
development conflicts are common.
• To prevent your working branch being overwritten by a
problematic commit, there is no auto-pull.
• To prevent not-ready code being sent to the remote, there is
no auto-commit/push.
Introduction to Github 135
Clone/Fork
• You can clone other developer’s repository,
and modify on branches as you like.
– You may do this on Github alone, creating the
remote clone of the original in your account.
(Called forking.)
– Note: However, pushing to original repository is
only allowed to the repo’s owners.
• If you have done valuable modification to the branch of
cloned/forked repo, you can ‘pull request’ to the owner.
• Push your branch to forked repo, then submit pull
request on the original repo.
Introduction to Github 136
.gitignore
• Sometimes you want certain files to stay
untracked/excluded from index.
– Especially data including privacy info.
• Then you can “無視”
(ignore) such data.
– Listed on .gitignore
• After that, commit the
branch
– .gitignore will be added
Introduction to Github 137
Back to the Past
• So how to return to previous state?
• 1-step back (just want to discard 1 commit):
– Already pushed? > git revert. Making new commit.
• But your code may already be used by someone.
– Not pushed? > Amend commit, or reset and start over.
• Multi-step back
– Make new branch on the past commit, checkout
(means moving your current branch(HEAD)), work on
it, eventually merge with master, or discard old
master and name the current as new master.
– Branching is has high flexibility.
Introduction to Github 138
Other stuff
• There are many more functions in git
– Notably rebase.
• But for now, that’s it!
– For personal/laboratory use, we learned more
than enough I believe.
• Utilize my account(/YuMatsuzawa/) for testing
Introduction to Github 139
CUI (Git for Windows required)
• $ cd <project directory>
• $ git init #repo created
• $ git add <files to be added>
• $ git commit –a #commit all
• $ git remote add origin <remote URI>
#remote config
• $ git fetch origin #fetch any branches
• $ git merge origin/master #merge remote tracker
• $ git push origin master #push to remote
Introduction to Github 140

More Related Content

What's hot

Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Simplilearn
 
Linux on Open Source Hardware with Open Source chip design (36c3)
Linux on Open Source Hardware with Open Source chip design (36c3)Linux on Open Source Hardware with Open Source chip design (36c3)
Linux on Open Source Hardware with Open Source chip design (36c3)Drew Fustini
 
Enterprise git
Enterprise gitEnterprise git
Enterprise gitPedro Melo
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git聖文 鄭
 
WTF is GitOps and Why You Should Care?
WTF is GitOps and Why You Should Care?WTF is GitOps and Why You Should Care?
WTF is GitOps and Why You Should Care?Weaveworks
 
Git Introduction
Git IntroductionGit Introduction
Git IntroductionGareth Hall
 
Git 101 tutorial presentation
Git 101 tutorial presentationGit 101 tutorial presentation
Git 101 tutorial presentationTerry Wang
 
Testing your puppet code
Testing your puppet codeTesting your puppet code
Testing your puppet codeJulien Pivotto
 
Docs or it didn’t happen
Docs or it didn’t happenDocs or it didn’t happen
Docs or it didn’t happenAll Things Open
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitE Carter
 
Postgresql 9.0 HA at RMLL 2012
Postgresql 9.0 HA at RMLL 2012Postgresql 9.0 HA at RMLL 2012
Postgresql 9.0 HA at RMLL 2012Julien Pivotto
 
Jenkins Shared Libraries
Jenkins Shared LibrariesJenkins Shared Libraries
Jenkins Shared LibrariesXPeppers
 
Advanced Git: Functionality and Features
Advanced Git: Functionality and FeaturesAdvanced Git: Functionality and Features
Advanced Git: Functionality and FeaturesBrent Laster
 
Using NuGet the way you should - TechDays NL 2014
Using NuGet the way you should - TechDays NL 2014Using NuGet the way you should - TechDays NL 2014
Using NuGet the way you should - TechDays NL 2014Maarten Balliauw
 
2017 jenkins world
2017 jenkins world2017 jenkins world
2017 jenkins worldBrent Laster
 
Writing Commits for You, Your Friends, and Your Future Self
Writing Commits for You, Your Friends, and Your Future SelfWriting Commits for You, Your Friends, and Your Future Self
Writing Commits for You, Your Friends, and Your Future SelfAll Things Open
 
Working with multiple git repositories
Working with multiple git repositoriesWorking with multiple git repositories
Working with multiple git repositoriesJulien Pivotto
 
Slack Bot: upload NUGET package to Artifactory
Slack Bot: upload NUGET package to ArtifactorySlack Bot: upload NUGET package to Artifactory
Slack Bot: upload NUGET package to ArtifactorySergey Dzyuban
 
GitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLabGitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLabShinu Suresh
 

What's hot (20)

Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
 
Linux on Open Source Hardware with Open Source chip design (36c3)
Linux on Open Source Hardware with Open Source chip design (36c3)Linux on Open Source Hardware with Open Source chip design (36c3)
Linux on Open Source Hardware with Open Source chip design (36c3)
 
Enterprise git
Enterprise gitEnterprise git
Enterprise git
 
Brief tutorial on Git
Brief tutorial on GitBrief tutorial on Git
Brief tutorial on Git
 
WTF is GitOps and Why You Should Care?
WTF is GitOps and Why You Should Care?WTF is GitOps and Why You Should Care?
WTF is GitOps and Why You Should Care?
 
Git Introduction
Git IntroductionGit Introduction
Git Introduction
 
Git 101 tutorial presentation
Git 101 tutorial presentationGit 101 tutorial presentation
Git 101 tutorial presentation
 
Testing your puppet code
Testing your puppet codeTesting your puppet code
Testing your puppet code
 
Docs or it didn’t happen
Docs or it didn’t happenDocs or it didn’t happen
Docs or it didn’t happen
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
 
Git training v10
Git training v10Git training v10
Git training v10
 
Postgresql 9.0 HA at RMLL 2012
Postgresql 9.0 HA at RMLL 2012Postgresql 9.0 HA at RMLL 2012
Postgresql 9.0 HA at RMLL 2012
 
Jenkins Shared Libraries
Jenkins Shared LibrariesJenkins Shared Libraries
Jenkins Shared Libraries
 
Advanced Git: Functionality and Features
Advanced Git: Functionality and FeaturesAdvanced Git: Functionality and Features
Advanced Git: Functionality and Features
 
Using NuGet the way you should - TechDays NL 2014
Using NuGet the way you should - TechDays NL 2014Using NuGet the way you should - TechDays NL 2014
Using NuGet the way you should - TechDays NL 2014
 
2017 jenkins world
2017 jenkins world2017 jenkins world
2017 jenkins world
 
Writing Commits for You, Your Friends, and Your Future Self
Writing Commits for You, Your Friends, and Your Future SelfWriting Commits for You, Your Friends, and Your Future Self
Writing Commits for You, Your Friends, and Your Future Self
 
Working with multiple git repositories
Working with multiple git repositoriesWorking with multiple git repositories
Working with multiple git repositories
 
Slack Bot: upload NUGET package to Artifactory
Slack Bot: upload NUGET package to ArtifactorySlack Bot: upload NUGET package to Artifactory
Slack Bot: upload NUGET package to Artifactory
 
GitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLabGitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLab
 

Viewers also liked

Become a Successful Web Developer in Web development Field in 2017
Become a Successful Web Developer in Web development Field in 2017Become a Successful Web Developer in Web development Field in 2017
Become a Successful Web Developer in Web development Field in 2017Imran Qasim
 
How GitHub Builds Software at Ruby Conference Kenya 2017 by Mike McQuaid
How GitHub Builds Software at Ruby Conference Kenya 2017 by Mike McQuaidHow GitHub Builds Software at Ruby Conference Kenya 2017 by Mike McQuaid
How GitHub Builds Software at Ruby Conference Kenya 2017 by Mike McQuaidMichael Kimathi
 
MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017Dave Stokes
 
O'Leary - Using GitHub for Enterprise and Open Source Documentation
O'Leary - Using GitHub for Enterprise and Open Source DocumentationO'Leary - Using GitHub for Enterprise and Open Source Documentation
O'Leary - Using GitHub for Enterprise and Open Source DocumentationLavaCon
 
Finding Similar Projects in GitHub using Word2Vec and WMD
Finding Similar Projects in GitHub using Word2Vec and WMDFinding Similar Projects in GitHub using Word2Vec and WMD
Finding Similar Projects in GitHub using Word2Vec and WMDMasudur Rahman
 
MySQL Replication Evolution -- Confoo Montreal 2017
MySQL Replication Evolution -- Confoo Montreal 2017MySQL Replication Evolution -- Confoo Montreal 2017
MySQL Replication Evolution -- Confoo Montreal 2017Dave Stokes
 
Know the Science behind WorkFlows using Git & GitHhub
Know the Science behind WorkFlows using Git & GitHhubKnow the Science behind WorkFlows using Git & GitHhub
Know the Science behind WorkFlows using Git & GitHhubEdureka!
 
Using Git and GitHub Effectively at Emerge Interactive
Using Git and GitHub Effectively at Emerge InteractiveUsing Git and GitHub Effectively at Emerge Interactive
Using Git and GitHub Effectively at Emerge InteractiveMatthew McCullough
 
Advanced MySQL Query Optimizations
Advanced MySQL Query OptimizationsAdvanced MySQL Query Optimizations
Advanced MySQL Query OptimizationsDave Stokes
 

Viewers also liked (9)

Become a Successful Web Developer in Web development Field in 2017
Become a Successful Web Developer in Web development Field in 2017Become a Successful Web Developer in Web development Field in 2017
Become a Successful Web Developer in Web development Field in 2017
 
How GitHub Builds Software at Ruby Conference Kenya 2017 by Mike McQuaid
How GitHub Builds Software at Ruby Conference Kenya 2017 by Mike McQuaidHow GitHub Builds Software at Ruby Conference Kenya 2017 by Mike McQuaid
How GitHub Builds Software at Ruby Conference Kenya 2017 by Mike McQuaid
 
MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017MySQL 101 PHPTek 2017
MySQL 101 PHPTek 2017
 
O'Leary - Using GitHub for Enterprise and Open Source Documentation
O'Leary - Using GitHub for Enterprise and Open Source DocumentationO'Leary - Using GitHub for Enterprise and Open Source Documentation
O'Leary - Using GitHub for Enterprise and Open Source Documentation
 
Finding Similar Projects in GitHub using Word2Vec and WMD
Finding Similar Projects in GitHub using Word2Vec and WMDFinding Similar Projects in GitHub using Word2Vec and WMD
Finding Similar Projects in GitHub using Word2Vec and WMD
 
MySQL Replication Evolution -- Confoo Montreal 2017
MySQL Replication Evolution -- Confoo Montreal 2017MySQL Replication Evolution -- Confoo Montreal 2017
MySQL Replication Evolution -- Confoo Montreal 2017
 
Know the Science behind WorkFlows using Git & GitHhub
Know the Science behind WorkFlows using Git & GitHhubKnow the Science behind WorkFlows using Git & GitHhub
Know the Science behind WorkFlows using Git & GitHhub
 
Using Git and GitHub Effectively at Emerge Interactive
Using Git and GitHub Effectively at Emerge InteractiveUsing Git and GitHub Effectively at Emerge Interactive
Using Git and GitHub Effectively at Emerge Interactive
 
Advanced MySQL Query Optimizations
Advanced MySQL Query OptimizationsAdvanced MySQL Query Optimizations
Advanced MySQL Query Optimizations
 

Similar to Introduction to github using Egit

Intro to Git for Drupal 7
Intro to Git for Drupal 7Intro to Git for Drupal 7
Intro to Git for Drupal 7Chris Caple
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Derek Jacoby
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2Derek Jacoby
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIsTim Osborn
 
Introduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticleIntroduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticlePRIYATHAMDARISI
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners HubSpot
 
Open up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHubOpen up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHubScott Graham
 
Beginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdfBeginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdfGDSCKNUST
 
Git extension-training
Git extension-trainingGit extension-training
Git extension-trainingEric Guo
 
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Ahmed El-Arabawy
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hubNaveen Pandey
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitRobert Lee-Cann
 
Git Introductive
Git IntroductiveGit Introductive
Git IntroductiveAdham Saad
 

Similar to Introduction to github using Egit (20)

Demo
DemoDemo
Demo
 
Intro to Git for Drupal 7
Intro to Git for Drupal 7Intro to Git for Drupal 7
Intro to Git for Drupal 7
 
CICD_1670665418.pdf
CICD_1670665418.pdfCICD_1670665418.pdf
CICD_1670665418.pdf
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIs
 
Introduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticleIntroduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech Article
 
git and github
git and githubgit and github
git and github
 
Git preso to valtech cfml team
Git preso to valtech cfml teamGit preso to valtech cfml team
Git preso to valtech cfml team
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Open up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHubOpen up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHub
 
Github basics
Github basicsGithub basics
Github basics
 
Beginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdfBeginner Workshop for Student Developers - Tratech-presentation.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdf
 
Git and Github Session
Git and Github SessionGit and Github Session
Git and Github Session
 
Git extension-training
Git extension-trainingGit extension-training
Git extension-training
 
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
 
Hello, Git!
Hello, Git!Hello, Git!
Hello, Git!
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
 
Git Introductive
Git IntroductiveGit Introductive
Git Introductive
 

Recently uploaded

WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...WSO2
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
WSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration ToolingWSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration ToolingWSO2
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2
 
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdfAzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdfryanfarris8
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2
 

Recently uploaded (20)

WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AI
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
WSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration ToolingWSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration Tooling
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - Kanchana
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdfAzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 

Introduction to github using Egit

  • 1. Introduction to Github with Egit 2014 /YuMatsuzawa/
  • 2. Github?? • Google it, now. • Or, https://github.com/ Introduction to Github 2
  • 4. Github?? Introduction to Github 4 Make your account, now.
  • 5. Github?? Introduction to Github 5 Make your account, now. Or, Login if already got one.
  • 7. You will see… Introduction to Github 7 …then you are ready.
  • 8. LOLWATTZDIS? • With Github, you can… – Find/Clone/Help someone else’s nice projects. – Sync your progress across multiple machines. – Roll back your project to previous state. – Publish/Share your project. • “Git” is one of many Version Control Systems (VCS). • Github is one of public platforms (hubs) of Git. Introduction to Github 8
  • 9. LOLWATSDIS? • With Github, you can… – Find/Clone/Help someone else’s nice projects. – Sync your progress across multiple machines. – Roll back your project to previous state. – Publish/Share your project. • “Git” is one of many Version Control Systems (VCS). • Github is one of public platforms (hubs) of Git. Introduction to Github 9 • Seems nice, but what is ‘cloning’?  Cloning a project is basically copying it to your machine/environment to extend it as you like.  You can clone any public projects including very famous one such as jQuery (/jQuery/jQuery) • How to help someone?  Clone their project, modify, and offer your help as ‘pull request’ (covered later)
  • 10. LOLWATSDIS? • With Github, you can… – Find/Clone/Help someone else’s nice projects. – Sync your progress across multiple machines. – Roll back your project to previous state. – Publish/Share your project. • “Git” is one of many Version Control Systems (VCS). • Github is one of public platforms (hubs) of Git. Introduction to Github 10 • Thanks a bunch! But how?  Covered later in detail; in a few words: 1. Uploading your progress to Github 2. Downloading it to other machines 3. (Conflict shall be checked/marked) • Is it automatic?  NO. Why? Covered later.
  • 11. LOLWATSDIS? • With Github, you can… – Find/Clone/Help someone else’s nice projects. – Sync your progress across multiple machines. – Roll back your project to previous state. – Publish/Share your project. • “Git” is one of many Version Control Systems (VCS). • Github is one of public platforms (hubs) of Git. Introduction to Github 11 • Why this is important?  When you mess up with your project and it stops working (happens often), you can come back to the point it had worked. • To any states before? Any limit?  No limitation. Github doesn’t have “max space.” You’ll see why.
  • 12. LOLWATSDIS? • With Github, you can… – Find/Clone/Help someone else’s nice projects. – Sync your progress across multiple machines. – Roll back your project to previous state. – Publish/Share your project. • “Git” is one of many Version Control Systems (VCS). • Github is one of public platforms (hubs) of Git. Introduction to Github 12 • Could be useful… but can I keep it private?  NO. This is why github is free AND space- unlimited. Projects uploaded on github is considered public assets(or Open Source Software) thus forcibly published. • Really?  …Unless you pay at least $7/month.
  • 13. Now you know Github is • Platform of distributed development for Open Source Software using Git – Actually, not limited to software. Any contents can be managed on github (images, .doc, .xls, etc.) – You must acknowledge contents on Github is published, thus you shouldn’t upload restricted contents (such as data including private info.) – Let’s delve into “How” Introduction to Github 13
  • 14. From Where? • Basic Git is CUI thing – You may learn/use Git this way, and actually, sometimes, for some kind of people, it’s even easier. But for now… • Let’s do this from Eclipse GUI (for Java users) Introduction to Github 14
  • 15. Requirement • Any working Eclipse (not too old one) • ssh-keygen – Included in recent versions of Eclipse – Other ways: • On Mac/Linux this is innately installed • On Windows: – If you have cygwin installed, you’re OK. – If you have PuTTY or TeraTerm installed, you’re OK. – Otherwise, install TeraTerm. » PuTTY and TeraTerm are both terminal emulator. For OpenSSH keygen purpose, TeraTerm is simpler and easier. Introduction to Github 15
  • 16. EGit • … is Eclipse plugin for Git. • Install it. 1. Launch Eclipse 2. Help > Eclipse Marketplace 3. Search “EGit” 4. Install Introduction to Github 16
  • 17. Prepare SSH public key • Stay in Eclipse • Open “設定”(Preferences) – “一般”(General)>”ネットワーク接続”(Network Connection)>”SSH2” – “鍵管理”(Key Management) – “RSA鍵の生成”(Generate RSA Key) – “秘密鍵の保管”(Save Private Key) • Default name would be “id_rsa” • Path should be <user>/.ssh/ Introduction to Github 17
  • 18. Prepare SSH public key • If you already got one, new key isn’t required – Found “<user>/.ssh/id_rsa.pub” ? => Done. • On Mac/Linux or Cygwin: – Launch Terminal or Cygwin – Type “ssh-keygen” • Save/Move your key under <user>/.ssh/ • On TeraTerm: – Cancel “新しい接続” – “設定” > “SSH鍵生成” • Save under <user>/.ssh/ Introduction to Github 18
  • 19. Prepare SSH public key • On PuTTY: – Find PuTTYGen in PuTTY install directory – “生成”(Generate) – (Move cursor around) – “変換”(Convert) >“OpenSSH形式” • This is for private key – Save as appropriate name • Default: <user>/.ssh/id_rsa • No extension needed Introduction to Github 19
  • 20. Prepare SSH public key – Copy this • PuTTYGen generate original format ssh key • OpenSSH format key required • This is for pubic key – Open text editor – Paste – Save as appropriate name • Default: “id_rsa.pub” Introduction to Github 20
  • 28. Register public key Introduction to Github 28 Paste the content of generated id_rsa.pub here Appropriate title
  • 29. Specify SSH private key for Eclipse • Generated your key via Eclipse? => Done. • If not: – Your key is <user>/.ssh/id_rsa? => Done. – If not: • Open “設定” • “一般”>”ネットワーク接続”>”SSH2” • “秘密鍵の追加”(Add Private Key) • Specify your key name – Make sure it’s stored under <user>/.ssh/ Introduction to Github 29
  • 30. Authentication Method • “認証方法”(Authentication Methods) • Uncheck “password” – Only key authentication • Now everything ready! Introduction to Github 30
  • 31. Create Repository • What’s “repository”? – Storage for Git objects – There must be remote repository on Github AND local repository on your machine – Concept: Transactions are done between repositories (specific locations) Introduction to Github 31
  • 35. Create Remote Repository Introduction to Github 35 Appropriate title Description Cannot choose Private on unpaid account Make README
  • 37. Share your existing project • Open your project • Right click • チーム”Team” • プロジェクトの共用 “Share the project” • “Git” Introduction to Github 37
  • 39. Create Local Repository • Where to reposit? – Recommended: Distinct, new path dedicated only for that repository outside of Eclipse workspace • Not the same as the already existing project directory (usually in Eclipse workspace) • Why? -> Several reasons. Primarily for future use when you would want to place multiple projects in that repo. • Faster (Git only cares about files inside the repo) – Easier to understand: Project directory • No need to move files (easier to initialize) • Sometimes slower (Git starts to check files in workspace) Introduction to Github 39
  • 40. Create Local Repository • Where to reposit? – Recommended: Distinct, new path dedicated only for that repository outside of Eclipse workspace • Not the same as the already existing project directory (usually in Eclipse workspace) • Why? -> Several reasons. Primarily for future use when you would want to place multiple projects in that repo. • Faster (Git only cares about files inside the repo) – Easier to understand/start: Project directory • No need to move files (easier to initialize) • Sometimes slower (Git starts to check files in workspace) Introduction to Github 40 …If you are certain about 1 project <-> 1 repo philosophy Go to
  • 44. Create Local Repository Introduction to Github 44 Aforementioned recommendation Ignore warning and create repo
  • 45. Create Local Repository • If you are to place your repo outside of Eclipse workspace… Introduction to Github 45
  • 46. Create Local Repository • If you are to place your repo outside of Eclipse workspace… Introduction to Github 46 Default path would be /<user>/git/ After proceeding, project migration to new path will begin.
  • 47. Introduction to Github 47 Repository Ready
  • 48. Introduction to Github 48 Repository Ready Open Git repositories pane. ウィンドウ>ビューの表示>その他>チーム Indicators appeared (‘>’,’?’,’[NO-HEAD]’,…)
  • 49. A little backtracking • It’s good time to learn how exactly Git works. Introduction to Github 49
  • 50. A little backtracking • It’s good time to learn how exactly Git works. Introduction to Github 50 GithubYour Machine Your Eclipse
  • 51. A little backtracking • You’ve created repositories. Introduction to Github 51 Github Your Eclipse Remote RepositoryLocal Repository Your Machine
  • 52. A little backtracking • Obviously, you want to store your project. • …but making repository is just a first step. Introduction to Github 52 Github Your Eclipse Remote RepositoryLocal Repository Your Machine
  • 53. A little backtracking • Inside repos are indexes (file lists) • Indexes track what files belong to the repos Introduction to Github 53 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -… -… -… Index -… -… -…
  • 54. A little backtracking • Inside repos are indexes (file lists) • Indexes track what files belong to the repos • You can ‘git add’ to the index Introduction to Github 54 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… ‘git add’!! Added!
  • 55. A little backtracking • Now the local repo knows your files • But only their existence. • Repo must know if files are ready to be shared/launched Introduction to Github 55 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -…
  • 56. A little backtracking • Your next move is to register your progress • • Introduction to Github 56 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -…
  • 57. A little backtracking • Your next move is to register your progress. • ‘git commit’ is the way to go. • Records your current progress on indexed files to the repo. Introduction to Github 57 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… ‘git commit’!!
  • 58. A little backtracking • You commit to a specific “branch” • Branch = Front-ends of devel. flows (latest commits) First commit creates ‘master’ Introduction to Github 58 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… c00 master Created!
  • 59. A little backtracking • If you modify your files and commit again, • Introduction to Github 59 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… ‘git commit’!! master c00
  • 60. A little backtracking • If you modify your files and commit again, • …that records are committed to currently targeted branch (in this case ‘master’). New one becomes branch. Introduction to Github 60 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… master c00 c01
  • 61. A little backtracking • You can make another branch • Introduction to Github 61 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… master c00 c01 c02 c03 another
  • 62. A little backtracking • You can make another branch • Committing to another branch will separate the flow. Introduction to Github 62 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… master c00 c01 c02 c03 a01a00 another
  • 63. A little backtracking • You can make another branch • Committing to another branch will separate the flow. • Also you can merge them. Introduction to Github 63 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… master c00 c01 c02 c03 a01a00 m00
  • 64. A little backtracking • If branches conflict (like edited same file), • Introduction to Github 64 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… master c00 c01 c02 c03 a01a00 another
  • 65. A little backtracking • If branches conflict (like edited same file), • …Git notifies conflicting files. Introduction to Github 65 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… master c00 c01 c02 c03 a01a00 another
  • 66. A little backtracking • If branches conflict (like edited same file), • …Git notifies conflicting files. • Then you must manually fix conflicts then add again. Introduction to Github 66 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… master c00 c01 c02 c03 a01a00 another Fix & ‘git add’!!
  • 67. A little backtracking • If branches conflict (like edited same file), • …Git notifies conflicting files. • Then you must manually fix conflicts then add again. Introduction to Github 67 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… master c00 c01 c02 c03 a01a00 m00
  • 68. A little backtracking • Anyway, let’s go committing for now! • Back to Eclipse… Introduction to Github 68 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… c00 master Created!
  • 69. Introduction to Github 69 Add/Commit Indicators appeared (‘>’,’?’,’[NO-HEAD]’,…)
  • 70. Introduction to Github 70 Add/Commit These indicator means: > -Uncommitted changes exists ? -Not added to the index * -Added but uncommitted (‘staged’) [<branch name>] -Current branch** **Pointer/cursor to current branch is called ‘HEAD’. ‘NO-HEAD’ means no branch specified. Indicators appeared (‘>’,’?’,’[NO-HEAD]’,…)
  • 71. Introduction to Github 71 Add/Commit • Right click on the project, • “チーム”(Team), • You’ll find its contents changed • “コミット”(Commit) • (You can do the same thing by right-clicking the repository from the repositories pane.)
  • 72. Introduction to Github 72 Add/Commit • (This window can differ from an Eclipse version to another, this is Juno 4.2.2) • Commit Message is important feature used for explaining what changes are made. • Keep it simple but understandable • If there are untracked files, you can add them here. (Check this “Show untracked”) Hit “Commit” if messages/adding files are ready
  • 73. Add/Commit • Gratz! Your first LOCAL commit (+ add) is made. • You notice the ‘>’ indicator disappeared from the project. – This means the local repository now stored your progress. Introduction to Github 73
  • 74. “Remote Control” • Next step is to interact with the remote repo. • Introduction to Github 74 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… c00 master Created!
  • 75. “Remote Control” • Next step is to interact with the remote repo. • Remote contents are managed with similar branch system. • On repo creation, remote ‘master’ was also made. Introduction to Github 75 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… c00 master r00 master
  • 76. “Remote Control” • Now, you need special local branch. • Introduction to Github 76 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… r00 masterc00 master
  • 77. “Remote Control” • Now, you need special local branch. • So-called “remote tracking” • This branch tracks/syncs with status of remote branch. Introduction to Github 77 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… r00 master r00 origin/master c00 master
  • 78. “Remote Control” • ‘origin’ means it’s your primary remote repo. • ‘origin/master’ means it syncs with ‘master’ branch on your remote repo. Introduction to Github 78 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… r00 master r00 origin/master *These are just a common tactics to name a remote tracker. You may name yours as you want. c00 master
  • 79. “Remote Control” • Tracker will ‘git fetch’ the remote contents. • The first fetch creates the remote tracker. Introduction to Github 79 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… r00 master r00 origin/master Created! ‘git fetch’!! c00 master
  • 80. “Remote Control” • Then you merge 2 local branches. • Introduction to Github 80 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… c00 master r00 master r00 origin/master
  • 81. “Remote Control” • Then you merge 2 local branches. • Now local ‘master’ contains all contents from local & remote. Introduction to Github 81 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… c00 master r00 master r00 origin/master m00 *In distributed developments, conflicts can happen on this phase. **If you followed this instruction, local ‘master’ contains your local project and initially created README from remote at this moment.
  • 82. “Remote Control” • With fetch & merge, local branch is up-to-date • Normally you do this before starting your work of the day. • You may just ‘git pull’ here. Introduction to Github 82 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… c00 master r00 master r00 origin/master m00 *Pull basically means ‘fetch then merge’ combined.
  • 83. “Remote Control” • Next move obviously, is going opposite way • Introduction to Github 83 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… c00 master r00 master r00 origin/master m00
  • 84. “Remote Control” • Next move obviously, is going opposite way • At this point all tools are set. • ‘git push’ will do the trick. Introduction to Github 84 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… c00 master r00 master r00 origin/master m00 *Push will commit to the remote tracker, then sync it to the branch on the remote by uploading/overwriting contents. **Again, conflicts can happen here, and your push sometimes ‘rejected’ by the remote. If so, you need to fetch & merge. r01 ‘git push’!! r01
  • 85. “Remote Control” • So, in summary: • Pull (fetch & merge). Remote tracker created. (Do work.) Push. Done. Let’s do this -> Introduction to Github 85 Github Your Eclipse Remote RepositoryLocal Repository Your Machine Index -File1 -File2 -… Index -… -… -… c00 master r00 master r00 origin/master m00 r01 r01
  • 86. Remote Configuration Introduction to Github 86 Back to Web Browsers. Your Remote Repo page.
  • 87. Remote Configuration Introduction to Github 87 Back to Web Browsers. Your Remote Repo page. Copy this address. Make sure its ‘SSH’. *You registered SSH key, so you can pull/push via SSH connection. **You can pull via HTTPS, but cannot push.
  • 89. Remote Configuration Introduction to Github 89 In the Repo Pane, under the repo > “リモート”(Remote)
  • 90. Remote Configuration Introduction to Github 90 Right click > “リモートの作成”(Create a remote) In the Repo Pane, under the repo > “リモート”(Remote)
  • 91. Remote Configuration • Making push configuration first would be a little easier. Introduction to Github 91
  • 92. Push Configuration Introduction to Github 92 Click this to expand
  • 94. PushConfiguration Introduction to Github 94 Your copied address should automatically be inserted from clipboard. No need to modify username/password. ‘git’ is global username, auth’ed by key
  • 96. Push Configuration Introduction to Github 96 What was HEAD? > Reference to current branch. Click & focus here, then hit Ctrl+Space
  • 97. Push Configuration Introduction to Github 97 Complement service will automatically search existing remote branches. Choose ‘master’ branch.
  • 98. Push Configuration Introduction to Github 98 Checking this has literal meaning. When pushing, it will ignore push rejection from the remote branch and forcibly push the local HEAD. Generally a bad idea.
  • 100. Push Configuration Introduction to Github 100 • Repositories Pane should now be like this.
  • 101. Push Configuration Introduction to Github 101 • Repositories Pane should now be like this. • Right click on ‘origin’ • “フェッチの構成”(Configure fetch)
  • 103. Fetch Configuration Introduction to Github 103 Exactly the same as push
  • 105. Fetch Configuration Introduction to Github 105 Again, click & focus here, then hit Ctrl+Space. Choose ‘master’.
  • 106. Fetch Configuration Introduction to Github 106 Another overwrite option. Better not check.
  • 107. Fetch Configuration Introduction to Github 107 Now that fetch configuration is ready, let’s try fetching for the first time! Remember, first fetch will create the remote tracking branch ‘origin/master’
  • 108. Fetch Introduction to Github 108 Result should be like this. Server certification acceptance may be prompted.
  • 109. Remote Tracking Branch • Under “ブランチ”(Branch) >”リモート・トラッキング”(Remote tracking), you will find ‘origin/master’ • To reflect the remote status to local… Introduction to Github 109
  • 110. Merge • Right click on the remote tracker • “マージ”(Merge) Introduction to Github 110
  • 111. Merge • At this time, result should be like this. • Key is ‘Fast-forward’(FF) – Basically means no conflicts there. – To be precise, one branch is wholly older, and its recent commit is included in the other. Introduction to Github 111
  • 112. Merge • Here comes README from the remote joining the local. • Finally, to upload this merged commit to the remote… Introduction to Github 112
  • 113. Push Introduction to Github 113 2 ways of doing this: Right click on the project > “チーム”(Team) >”アップストリームへプッシュ” (Push to upstream) or Right click on ‘origin’ under “リモート” >”プッシュ”(Push)
  • 114. Push Introduction to Github 114 • Result should be like this. • At this time no rejection for sure.
  • 115. Check on Github Introduction to Github 115 Back to Web Browsers. Try refresh.
  • 116. Check on Github Introduction to Github 116 Happy face 
  • 117. Easier way for daily use • Now the very basic git usage is covered. • May pull / commit and push as shortcut. Introduction to Github 117
  • 118. Versioning • Versioning is done through tagging in git. • You may noticed “タグ”(Tag) in the repo pane. • Right click and “タグの作成”(Create a tag) Introduction to Github 118
  • 119. Tag Introduction to Github 119 Hit this to expand
  • 120. Tag Introduction to Github 120 Appropriate name (such as v1.0, v2.4-beta) Description message Choose a commit you want to tag
  • 121. Tag • Now that commits are tagged. • If you want to publish these tags (versions), you need to push tags manually. – Not tied to branch pushing, but the concept is exactly the same. Introduction to Github 121
  • 122. Push Tag • Right click on the tag > “Push Tag” • “構成済みレポジトリー” (Configured Repository) • Hit Next Introduction to Github 122
  • 123. Push Tag • Tricky part: Tags are referred like ‘refs/tags/<tag name>’. Introduction to Github 123
  • 124. Push Tag • Tricky part: Tags are referred like ‘refs/tags/<tag name>’. • You need to manually specify this. Introduction to Github 124 Target name
  • 125. Push Tag • Tricky part: Tags are referred like ‘refs/tags/<tag name>’. • You need to manually specify this. • Basically just copy the name above. Introduction to Github 125 Target name (refs/tags/v1.1)
  • 126. Push Tag • Result should be like the left • On Github, ‘releases’ should appear and you can see the version history Introduction to Github 126
  • 127. Versioning • Versioning itself needs its own philosophy and practice, and it’s ultimately depends on how the team will handle the project. • Make/follow the guideline and decide when/how often/what kind of state to publish. Introduction to Github 127
  • 128. From Remote, Comes… • So far, we assumed you have your local project developed without using git. • And how to integrate it with git is covered. • Let’s see how to duplicate your git-integrated project to your extra machines. • Or to duplicate other’s project. – These are done with exact same procedure. Introduction to Github 128
  • 129. Clone • You can ‘git clone’ the remote repo itself. • Introduction to Github 129 Github Your Eclipse Remote Repository Your Machine Index -… -… -… r00 master r01
  • 130. Clone • You can ‘git clone’ the remote repo itself. • And it’s really easy! • Not only it copies contents of the repo, it automatically set all the remote configuration! Introduction to Github 130 Github Your Eclipse Remote Repository Your Machine Index -… -… -… r00 master r01 Local Repository Index -File1 -File2 -… c00 master r00 origin/master m00 r01 ‘git clone’!! Created! Created! Created! Created!
  • 131. Clone • All you need is… • Copy. Introduction to Github 131 This.
  • 132. Clone • On your target machine, • Right click on the blank area of the repo pane. • “リポジトリー・パスまたはURIの貼り付け” Introduction to Github 132
  • 133. Clone Introduction to Github 133 Same as before.
  • 134. Clone Introduction to Github 134 You cannot clone to non-empty path. If the repo includes Java project, you can also import them.
  • 135. Clone • With cloning, you can duplicate your Eclipse project env. on another machine with ease. – As long as you respect the procedure of pull/modify/commit/push, you can work on your project from various places without an issue. – But sometimes an error will happen. And in a team development conflicts are common. • To prevent your working branch being overwritten by a problematic commit, there is no auto-pull. • To prevent not-ready code being sent to the remote, there is no auto-commit/push. Introduction to Github 135
  • 136. Clone/Fork • You can clone other developer’s repository, and modify on branches as you like. – You may do this on Github alone, creating the remote clone of the original in your account. (Called forking.) – Note: However, pushing to original repository is only allowed to the repo’s owners. • If you have done valuable modification to the branch of cloned/forked repo, you can ‘pull request’ to the owner. • Push your branch to forked repo, then submit pull request on the original repo. Introduction to Github 136
  • 137. .gitignore • Sometimes you want certain files to stay untracked/excluded from index. – Especially data including privacy info. • Then you can “無視” (ignore) such data. – Listed on .gitignore • After that, commit the branch – .gitignore will be added Introduction to Github 137
  • 138. Back to the Past • So how to return to previous state? • 1-step back (just want to discard 1 commit): – Already pushed? > git revert. Making new commit. • But your code may already be used by someone. – Not pushed? > Amend commit, or reset and start over. • Multi-step back – Make new branch on the past commit, checkout (means moving your current branch(HEAD)), work on it, eventually merge with master, or discard old master and name the current as new master. – Branching is has high flexibility. Introduction to Github 138
  • 139. Other stuff • There are many more functions in git – Notably rebase. • But for now, that’s it! – For personal/laboratory use, we learned more than enough I believe. • Utilize my account(/YuMatsuzawa/) for testing Introduction to Github 139
  • 140. CUI (Git for Windows required) • $ cd <project directory> • $ git init #repo created • $ git add <files to be added> • $ git commit –a #commit all • $ git remote add origin <remote URI> #remote config • $ git fetch origin #fetch any branches • $ git merge origin/master #merge remote tracker • $ git push origin master #push to remote Introduction to Github 140