emailconfirmed, nsInternRO, nsInternRW, Administrators
3,356
edits
(created full git tutorial) |
m (Fixed headline numbering) |
||
Line 1: | Line 1: | ||
== | == Download & Install Git on your Machine == | ||
open up your Terminal / Console and type | open up your Terminal / Console and type | ||
Line 9: | Line 9: | ||
== | == Setup == | ||
'''If you're using git for the first time''', you might want to setup some configuration settings: | '''If you're using git for the first time''', you might want to setup some configuration settings: | ||
Line 27: | Line 27: | ||
== | == Create the Project Folder == | ||
Create or select your project folder, '''c'''hange to this '''d'''ir in terminal and init git. This will create a ".git" folder inside your project. If you want to remove the git version control for whatever reason, you just need to delete this folder | Create or select your project folder, '''c'''hange to this '''d'''ir in terminal and init git. This will create a ".git" folder inside your project. If you want to remove the git version control for whatever reason, you just need to delete this folder | ||
Line 40: | Line 40: | ||
== | == Init the Project Folder == | ||
Now, let's add git to our new folder: | Now, let's add git to our new folder: | ||
Line 52: | Line 52: | ||
This is acutally a command, you should remember! | This is acutally a command, you should remember! | ||
== | == Adding Files == | ||
The status should say something like this: | The status should say something like this: | ||
Line 87: | Line 87: | ||
== | == Change Stuff == | ||
Open REAMDE.md and type something. | Open REAMDE.md and type something. | ||
Line 100: | Line 100: | ||
== | == Commit Changes == | ||
Commit early and commit often! Really, I mean that! And don't put in glibberish, make a useful comment about what you did: | Commit early and commit often! Really, I mean that! And don't put in glibberish, make a useful comment about what you did: | ||
Line 126: | Line 126: | ||
== | == Change Stuff (Again) == | ||
Repeat step 5 and change the README.md file. | Repeat step 5 and change the README.md file. | ||
Line 169: | Line 169: | ||
== | == Commit (Again) == | ||
Commit early and commit often! Really, I mean that! And don't put in glibberish, make a useful comment about what you did: | Commit early and commit often! Really, I mean that! And don't put in glibberish, make a useful comment about what you did: | ||
Line 212: | Line 212: | ||
== | == What's the diff? == | ||
Time for a cup of fresh coffee. Now you have a nice version control system for your project and you can work with git locally. | Time for a cup of fresh coffee. Now you have a nice version control system for your project and you can work with git locally. | ||
Line 273: | Line 273: | ||
== | == GUI or not to GUI == | ||
Though, if you're not a nerd, you might enjoy a decent graphical user interface. Time to grab the GitHub.app | Though, if you're not a nerd, you might enjoy a decent graphical user interface. Time to grab the GitHub.app | ||
Line 287: | Line 287: | ||
== | == Branching == | ||
Adding another branch to your git repo is like duplicating the whole project folder (including the git commit history) and working on a second, completely different version. Like a real folder, you can delete this branch later on or (unlike a real folder) merge it with the current main branch. | Adding another branch to your git repo is like duplicating the whole project folder (including the git commit history) and working on a second, completely different version. Like a real folder, you can delete this branch later on or (unlike a real folder) merge it with the current main branch. | ||
Line 393: | Line 393: | ||
== | == Using Remote Git Servers == | ||
You can extend your local git repository with an online git server. This has two advantages: | You can extend your local git repository with an online git server. This has two advantages: | ||
Line 415: | Line 415: | ||
== | == Creating an Online Repository == | ||
If you've uploaded your public SSH key for your machine, you can continue setting up your user account and finally, create a new repository: | If you've uploaded your public SSH key for your machine, you can continue setting up your user account and finally, create a new repository: | ||
Line 436: | Line 436: | ||
== | == Push Changes to the Server == | ||
Pushing Changes, means uploading to the server. Because you can have more than one remote server in your repository, you have to state its name: | Pushing Changes, means uploading to the server. Because you can have more than one remote server in your repository, you have to state its name: | ||
Line 457: | Line 457: | ||
</source> | </source> | ||
== | == Changing Stuff (Again) == | ||
This time, we want to simulate someone else changing our sources. The easiest way for this demo, is to go to github.com and edit the Readme file. E.g. apply some formatting ('#' creates a headline), and give it a commit message. | This time, we want to simulate someone else changing our sources. The easiest way for this demo, is to go to github.com and edit the Readme file. E.g. apply some formatting ('#' creates a headline), and give it a commit message. | ||
== | == Pull or Fetch and Merge == | ||
Git has two commands to update itself from a remote repository: | Git has two commands to update itself from a remote repository: | ||
Line 537: | Line 537: | ||
* to the official [http://gitref.org/index.html Git Reference @ gitref.org] | * to the official [http://gitref.org/index.html Git Reference @ gitref.org] | ||
[[Category: | [[Category:Git]] | ||
[[Category:Tutorial]] | [[Category:Tutorial]] | ||
[[Category:Michael Markert]] | [[Category:Michael Markert]] |