Information

An dieser Website wird noch gearbeitet. Keine Garantie für Funktionalität und Inhalt!

Git-FAQ

Oft gestellte Fragen zum Umgang mit Github und Eclipse.

How to con­fi­gure e­clipse?

  1. Open EGit: Window -> Open Perspective -> Other -> Git.
  2. Import project:
    1. Click File.
    2. Click Import.
    3. Click Git.
    4. Click Projects from Git.
    5. Click Next.
    6. Select "Clone URI".
    7. Click Next.
    8. Enter the adress from the repository code page. ("HTTPS clone URL")
    9. Click Next.
    10. Select the branches you want to pull. (You can also pull them later)
    11. Click Next.
    12. Choose a directory to save the local repository.
    13. Click Next.
    14. Choose "Import existing projects".
    15. Click Next.
    16. Click Finish.
  3. Perspective Settings:
    1. Open Java Perspective.
    2. Open Package Explorer.
    3. Click "Open Menu". (Arrow to the bottom)
    4. Select Package Presentation -> Hierarchical.
    5. You now see the package structure as at file explorer.
  4. Git Settings:
    1. Click Menu Window.
    2. Click Preferences.
    3. Click Team.
    4. Click Git.
    5. Click Configuration.
    6. If key "user" is available store your username and your GitHub mail address here. If not add keys "user.name" and "user.email".
In the preferences menu, you can set many different settings. These are documented in the eclipse help (Help -> Help Contents).

How to cre­ate a Pull Re­quest?

Only possible via the GitHub interface.
  1. Open GitHub-Repository.
  2. Open Tab "<> Code".
  3. Click "(X) branches". (Status line at the top, second field)
  4. Within the concerning branch click "New Pull Request".

How to up­date my lo­cal re­po­si­to­ry?

  1. Open EGit-Perspective.
  2. Open Repositories View.
  3. Right-click on repository name.
    1. Option Fetch from Upstream: Only update the remote branches (the representation of the server branches).
    2. Option Pull: Also update the local branches (the branches where you commit your changes). The two different versions might have to merge.

How to ckeck­out a branch?

  1. Open EGit-Perspective.
  2. Open Repositories View.
  3. Right-click on the branch to checkout.
  4. Click on "Checkout" or "Checkout as New Local Branch" if you checkout a remote branch.

How to write code?

  1. Open Package View.
  2. Open a file by clicking on it.
  3. Edit and save the file.
  4. Observe the Code Conventions.

How to send my chan­ges to Git­Hub?

  1. Open Egit-Perspective.
  2. Open view "Git Staging".
  3. Drop all files you want to commit from "Unstaged Changes" to "Staged Changes".
  4. Write a description of your changes and click to "Commit".
    The changes are now in your local repository.
  5. In Repositories View, right-click on repository name.
  6. Click "Push to upstream".