![]() ![]() If you were to create a new branch with git checkout -b foo, that new branch doesn't have any upstream configured. That means a plain git push would work on that branch. When you git clone a repository, the primary branch of that repository (usually main or master) is automatically configured to have the corresponding branch on the remote from which you cloned it as its upstream. However, that can only work when Git actually knows what the branch's upstream is. Does this name exist for my main remote repository, or is it a purely local name? How do you even know what are the names of the remote repositories? If it IS the name of my main remote repo - why? Is it just because it's the name of the first branch I ever used to push code with? Is it even possible to rename it?Ī plain git push tells Git to push the current branch to the current branch's "upstream". However, I'm trying to understand the significance now, of the 'initialCommit' branch. I understand that 'master' and 'main', and even 'origin' are just names, and there's nothing particularly special about them. ![]() Ever since then, no matter what branch I check out on my local computer, I always have to do 'git push origin initialCommit'. However, the only way I was able to do the 'push' was via 'git push origin initialCommit'. I added a bunch of files and committed them, and then pushed them to github. I immediately created a branch using 'git branch -b initialCommit', so that I'd have a branch to work on. On my laptop, I did a git clone of the repo, using the github url. (My plan was to populate the repo from the code on my laptop, using git commands) So, I created a new repository on github, with nothing in it, not even a README file. Was hoping that if I understand what's going on with my main repo, I might understand these concepts a bit better. I understand the basic workflow of git (add, commit, push), and sort of understand the most basic concepts, but I struggle with understanding remote branches, refs, and things like that. ![]() Thanks in advance for any knowledge you're willing to share. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |