Skip to main content

Eclipse GitHub Repo

Creating New Repository

  1. Launch Github Desktop
  2. File > New repository
  3. Leave Default Path alone (E:\GitHub Repo). Just type in a name then Create Repository.
  4. After you create repository the new path will be E:\Github Repo\ProjectName
  5. Quickly access the new repository by doing... Repository > Show In Explorer in Github Desktop
    1. This is where you will be copying your eclipse source folder if it already exists.
    2. This is where you should create your new Eclipse project if it is a new project.

    Copy

  6. Place a .gitignore fromfile ain previousE:\Github projectRepo\ProjectName
  7. into
the same place.

Contents of .gitignore

  1. Repository > Show In Explorer
    1. This is where you will be copying your eclipse source folder if it already exists.
    2. This is where you should create your new Eclipse project if it is a new project.

4.5.1 Creating New Eclipse Project

image-1620189991100.png

Uncheck default location. Choose E:\GitHub Repo\The New Repo Folder
Folder. Then finish.

4.5.2 Importing Old Eclipse Project

In eclipse right click on the existing project. Then Show In > System Explorer.

Copy the project folder and paste it in the folder in step 4.1.

Your repository in step 4.5.1 should look like this now.

image-1620188747014.pngimage-1620188747014.png

In Eclipse.

    Delete the old project.

    1. File > Import > General > Projects from Folders or Archives...
    2. Locate the new project you copied in E:\Github Repo
    3. Done. Finished importing

    Finally committing

    If you are importing, Make sure you commit
     first. Then in Eclipse. Delete the old project.

    Now type in a summary in the githubGitHub app. And an optional description of the changes. Then press Commit.

    After you commit you have to Publish. in the top right.

    Any future commits have to be Pushed. also in the top right (it isn't called Published).

    Checking Out an Older Version


    In GitHub Desktop. Click on your repo. Repository -> Open in Command prompt.

    git log   // allows you to see all your commits
    
    git checkout commitnumber here // lets you go back to an older commit
    // example: git checkout 92753a2c847b035e3fa11a182a117247e5098a74
    
    // now check for changes in eclipse.
    // to go back to the main branch do
    git checkout main