1

I am new to git so sorry if the question is dumb.

I have a project called helloworld a branch called newfeatures which is not origin on github. My goal is to get all the files and folders into the folder in Eclipse directory I have specified we can call it /documents/eclipse/java.

What I did was that I install git then went into the development directory and typed

git init

git clone https://githuburlhere

I now have a folder called helloworld with a bunch of git-files but I don't see any java files from gihub. How can I get the files?

I have also tried

git pull origin newfeatures

But it said

fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

8
  • 1
    a bunch of Git files? Do you mean the hidden folder .git? Can you see the files in Github? Commented Jun 10, 2022 at 1:19
  • @Raptor, yes its README.md and .git with the latter having a bunch of folders like branches, hooks, info, logs, objects, refs and files like config, description, HEAD, index, packed-refs Commented Jun 10, 2022 at 1:20
  • To clone a specific branch, read this Commented Jun 10, 2022 at 1:22
  • Does this answer your question? How do I clone a specific Git branch? Commented Jun 10, 2022 at 1:22
  • 3
    git init is for when you want to make a new repo "here" (the current directory). git clone is for when you want to copy a repo from somewhere else to "here" (a subfolder in the current directory). Pick one or the other, but not both. Note I may have misunderstood the question, and if I did, you likely want one of the top answers to this question. Commented Jun 10, 2022 at 2:42

1 Answer 1

0

Try:

cd /documents/eclipse/java
git clone https://github.com/me/myproject
cd myproject
git switch newfeatures

If newfeatures exists on the remote origin side, it will be checked out locally.

Make sure to point your Eclipse workspace to /documents/eclipse/java/myproject.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.