Spencer Cooley
Spencer Cooley

Reputation: 8851

How can you fetch your whole repository from github?

enter image description here

Basically I am trying to figure out how I can work seamlessly on both my laptop and desktop. So, I start off on my laptop and make a blank html page. I push that change to github. I then sit down at my desktop, clone it, and then start a new branch called crazy_idea, do some crazy stuff. Push it. Now I want to go get some coffee so I take my laptop with me down the street. How do I get the changes that I made on my desktop?

I have tried this scenario already using $ git fetch [email protected]:SpencerCooley/sandbox.git crazy_idea , then $git checkout crazy_idea, but when I look at the code, it looks exactly the same as it did before I did the fetch. When I look at the actual code on my github account I can see the changes I made so I know that my pushes are successful. I think I am misunderstanding what fetch does. I thought it was supposed to pretty much bring down all of the latest changes without merging. I would really appreciate anyone's insight.

Upvotes: 0

Views: 6693

Answers (2)

Tekkub
Tekkub

Reputation: 31705

If you already have the repo on the second computer, just fetch the remote. That will bring in all the remote branches. If you don't have the repo, then clone, again that brings down everything. Once you have everything in the local repo you want to merge or create a local branch to access the new stuff.

You should probably take an evening and sit down with http://gitref.org/ so that you understand all the stuff you need for working with git on a day-to-day basis.

Upvotes: 1

Related Questions