0

When I look at my local git CLI repo (fork or clone of a GitHub repo, and also a GitHub for Windows repo), I see only the files in the "master" branch. I know I've created another branch for my feature coding ("git branch" shows it), but I can't find the files for this branch! The directory for the branch is missing. [local: Windows 10]

Also, should I be using git or GitHub or GitHub for Windows to generate a Pull Request to a repo on the GitHub website?

Is there any short tutorial that describes how to generate a Pull Request in the simplest way that does not use the git CLI? The existing tutorials just confuse me because they omit steps or because they are written for Linux programmers.

David Spector
  • 1,520
  • 15
  • 21
  • *The directory for the branch is missing* Branches aren't directories. You should learn the difference. See the Book: https://git-scm.com/book/en/v1/Git-Branching-What-a-Branch-Is – phd Jan 27 '19 at 14:34
  • *Also, should I be using git or GitHub or GitHub for Windows to generate a Pull Request* Anything will do. – phd Jan 27 '19 at 14:35
  • Is there any short tutorial that describes how to generate a Pull Request in the simplest way? Like this: https://stackoverflow.com/questions/14680711/how-to-do-a-github-pull-request ? – phd Jan 27 '19 at 14:37
  • Thank you all for the comments. I will edit my question to make it clear that I don't want to us the git CLI, since I am a Windows programmer. – David Spector Jan 27 '19 at 15:49
  • @DavidSpector Thanks for the clarification, I'm about to edit my answer. But as a sidenote I can't resist to mention that even as a Windows programmer myself, unexperienced in linux bash commands and such, I'm a strong advocate for CLI usage in git (I use Git Bash for Windows) over git GUIs. After a short period of learning, the benefit is huge in terms of understanding how git actually works. – Romain Valeri Jan 27 '19 at 16:35
  • I am experimenting and developing my own GitHub steps, which is my larger goal, at https://stackoverflow.com/questions/54390541/how-to-contribute-to-a-github-open-software-repository/54390542#54390542 . I'll continue these discussions there. – David Spector Jan 27 '19 at 16:56

1 Answers1

0

To further a bit on phd's totally correct comments, your branches directory is here :

.git/refs/heads/

But as you'll see confirmation in the suggested links above (to which I'd add this one about references), only lightweight references are there, each file is named for a branch and contains the SHA-1 of the commit the branch points to.

Git uses that at execution when you need to refer to anything metaphorically in that branch, like when you diff two branches, but it doesn't mean that every branch is an actual directory of files in a specific version, rather a way or a recipe to reconstruct a specific state from other points of the tree.

Romain Valeri
  • 19,645
  • 3
  • 36
  • 61
  • It looks like when you change the current branch, you get a directory-like web page: https://github.com/David263/velocity/tree/issue-900 . In this example "issue-900" is the name of my new branch. You can then edit or create the files in this new "directory". So even though branches are not directories, they look and act like directories on GitHub. Corrections welcome. – David Spector Jan 27 '19 at 16:22
  • @DavidSpector Rereading your question and your comment, I guess your mentions of CLI have lead me on a wrong path of reasonning (that I wrongly assumed you observed an absence of files directory in your local .git folder), you're right to point it out. I'll try to edit that ;-) – Romain Valeri Jan 27 '19 at 16:27