osx - Why do git commits exist on my local clone/directory but not on GitHub? -
i have committed , pushed several changes project using git on command line, when log in github, branches , commits made not shown on account. why?
i can review commit history have made using git on command line.
results of git remote -v
command
origin https://github.com/felixtan/guessing-game.git (fetch) origin https://github.com/felixtan/guessing-game.git (push)
once committed locally, still need push commits github:
git push
(since remote named origin, don't need specify name: pushes default 'origin')
this assumes owner or one of collaborators of repo felixtan/guessing-game.
if first time push current branch:
git push -u origin yourcurrentbranch
that establish tracking relationship between branch , 'origin/yourbranch
', detailed in "why need explicitly push new branch?".
once first push done, subsequent pushes simple 'git push
'.
if not owner/collaborator, won't have right push repo.
you need make fork (see github forking), , in local cloned repo working on:
git remote rename origin upstream git remote add origin https://yourlogin@github.com/yourlogin/guessing-game.git
that way, push fork (that own), , make pull requests there (see github pull requests).
Comments
Post a Comment