0

I've been trying to learn how to use GitHub but I just can't get a grasp on it.

One thing I want to do is, make a private fork from a public repo. For some reason the button to make a fork private is gone so now I have to 'duplicate' it.

Read some stuff hear and there and ended up using

git remote add upstream
git fetch upstream 
git rebase upstream/master

Commands were succesful, but I didn't notice a change, my duplicate didn't add the latest commits from the public repo.

I'm a little frustrated. I find GitHub incredibly hard to get grasp on.

I hope someone can ELI5 how I can update a duplicate of a repo, to the latest version of that repo. And explain it in detail so I learn what's it all about. I've been unsuccesful googling this.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
SJ19
  • 1,933
  • 6
  • 35
  • 68
  • I think this previous post may help you. You can no longer fork a public repo but you can duplicate it, which it sounds like you've done. http://stackoverflow.com/questions/10065526/github-how-to-make-a-fork-of-public-repository-private – jackie Sep 15 '15 at 15:46
  • http://try.github.com/ has some nice tutorials for using git. – Saa Sep 15 '15 at 15:52
  • What would be the most straightforward way to update a duplicate to the upstream repo? Everyone keeps throwing tons of information at me but I just first just want to know this single thing. – SJ19 Sep 15 '15 at 16:14

1 Answers1

0

To get a good grasp of git you have to first understand the concept of distributed repository. https://en.wikipedia.org/wiki/Distributed_version_control

This link has some basic commands on git.

http://rogerdudler.github.io/git-guide/

Some of my fav git commands

clone a remote repository

git clone https://xxxxx.git

update code

git pull

create a branch from master

git branch new-branch

checkout to the newly created branch

git checkout new-branch

status

git status

add new files

git add file or wildcard

commit changed files

git commit -m 'comments'

view changes that are just committed

git diff HEAD^ HEAD
git diff origin/master..HEAD

push the new branch to repo / update the branch

git push origin 'new-branch'

revert changes in a file

git checkout file

see changes that are about to be pushed

git diff local_branch origin/master

delete local branch

git branch -d the_local_branch
yogidilip
  • 790
  • 6
  • 21
  • One thing I've been confused about is, the GitHub UI has a great set of functions, and many of your commands can be done in the client, is there any specific reason to still use git commands over just using the UI? – SJ19 Sep 15 '15 at 16:00
  • I think it is just about preference. I prefer using command. I also use EGit sometime, which is a UI plugin for Eclipse. – yogidilip Sep 15 '15 at 16:09
  • What would be the most straightforward way to update a duplicate to the upstream repo? Everyone keeps throwing tons of information at me but I just first just want to know this single thing. – SJ19 Sep 15 '15 at 16:12
  • Are you trying to clone a public repo and upload it as your private ? – yogidilip Sep 15 '15 at 16:16
  • Yes, but the cloning and uploading can be done completely without git commands. I imported a repo as my private repo, now all I want is be able to update it if the public repo gets updated. – SJ19 Sep 15 '15 at 16:19
  • There must be a better process of doing this, but you can do a 'git pull' on public repo, merge it with your local copy of private repo and push those changes to your remote repo. – yogidilip Sep 15 '15 at 16:24
  • Hey, I've been trying stuff for hours and I still just can't figure it out, is there a possibility you could tell me step by step what to do? – SJ19 Sep 17 '15 at 18:00