2

I'm new to git and am struggling with this.

I need to grab some files from a Github branch (not even sure if this is the right terminology).

I tried:

git pull someones-project/feature/branch-123

and

git merge someones-project/feature/branch-123

and got Already up-to-date for both.

But it's not up-to-date. I can see files on Github that are missing from my local.

Can anyone point me in the right direction here?

MeltingDog
  • 14,310
  • 43
  • 165
  • 295

2 Answers2

3

As mentioned here:

The message “Already up-to-date” means that all the changes from the branch you’re trying to merge have already been merged to the branch you’re currently on

So your master branch appears to already have the commits from someones-project/feature/branch-123

git branch it tells me I am in the correct one (someones-project/feature/branch-123)

In that case, the local branch someones-project/feature/branch-123 is already updated, and any subsequent git pull or merge will always report "already up-to-date".

As Tim Biegeleisen comments, a git pull should be either:

git pull # pulls from origin the same branch you are on

Or:

git pull origin feature/branch-123 # pull the branch from the remote 
                                   # and merges it into the current branch
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Sorry, I don't understand - I can clearly see the missing files on Gtihub.com – MeltingDog Oct 28 '16 at 06:38
  • @MeltingDog what git remote -v returns? Is it the url of the repo you are looking at? – VonC Oct 28 '16 at 06:39
  • mycompany git@github.com:mycompany/mycompany.git (fetch) mycompany git@github.com:mycompany/mycompany (push) origin git@github.com:mycompany/mycompany.git (fetch) origin git@github.com:mycompany/mycompany.git (push) – MeltingDog Oct 28 '16 at 06:46
  • @MeltingDog is `someones-project/feature/branch-123` a branch that you see in `github.com:mycompany/mycompany.git`? Is it normal that you have two remote referencing the same "`github.com:mycompany/mycompany.git`" repo? – VonC Oct 28 '16 at 06:53
  • Yes it is. Sorry, I'm not sure about your 2nd question (I'm a newb). – MeltingDog Oct 30 '16 at 22:30
  • @MeltingDog My second question was about the output of `git remote -v`: both the remote named '`mycompany`' and the one named '`origin`' seem to reference the same url. I wanted to confirm this was the case. – VonC Oct 30 '16 at 22:36
  • @MeltingDog yet you see files missing when looking at that branch on the GitHub repo referenced by that url? – VonC Oct 30 '16 at 22:41
  • @MeltingDog If you don't have any work in progress, can you try a `git fetch` followed by a `git reset --hard origin/someones-project/feature/branch-123` and tells me if the local version of that resetted branch is now identical to the remote content you see on the remote repo? – VonC Oct 30 '16 at 22:43
  • no, I see the files I want on the GitHub repo. They're missing from my local machine. I'm trying to pull them down. – MeltingDog Oct 30 '16 at 22:56
  • @MeltingDog OK: hence my suggestion of `fetch` + `reset --hard`. – VonC Oct 30 '16 at 22:57
  • OK I'll give that a try! – MeltingDog Oct 30 '16 at 22:59
-2

From https://github.com/iradukundairenee/mybrand

  • branch ft-contact -> FETCH_HEAD Already up to date.