1

My Git knowledge wasn't very good but I hoped to get some insights on this step-by-step guide that my senior told me as I am running into some problem

Based on my understanding, I am a bit confused where there is a need to add in the remote repo since the items within and the repo I forked are basically the same.

It is as follows:

  • Fork a repo using the branch test_for_validation within the project called SITE
  • Clone the repo locally
  • Cd to local repo
  • git remote add site ssh://git@....git
  • git pull site
  • git checkout site/feature/test_for_validation
  • git checkout develop
  • git merge feature/test_for_validation

While I am at git pull site step, I am seeing a list of * [new branch] xxx followed with a message:

You asked to pull from the remote 'site', but did not specify
a branch. Because this is not the default configured remote
for your current branch, you must specify a branch on the command line.

Am I supposed to do something here?

Additionally, when I did the git clone into my machine, am I suppose to create all the branches, seeing that at the last step it is asking me to merge since currently I only have the master branch...

Lastly can I check if it is necessary for me to create a repository called test_for_validation as I am not seeing this repo of mine in the projects..

I am using Atlassian by the way

yan
  • 581
  • 8
  • 26

1 Answers1

0

Based on my understanding, I am a bit confused where there is a need to add in the remote repo since the items within and the repo I forked are basically the same.

You would add an 'upstream' remote in order to:

  • fetch updates from that original repo
  • rebase your own work (generally, a dedicated branch where you make your own contribution, in order to prepare a pull request)

fork

So in your guide: don't pull, just fetch.

Community
  • 1
  • 1
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • How about the branches then? Will there be a need to create out all of them? – yan Nov 20 '14 at 07:39
  • @yan no: you can create a local branch from `site/xxx` remote tracking branch which was imported by the fetch. – VonC Nov 20 '14 at 07:41
  • Since there is a need for it to be tracked, will using this command `git checkout --track site/develop` be okay? Adding on, are there any other commands to check if the state of the created branches are tracked or where do they come from `site/xxx` etc? – yan Nov 20 '14 at 09:08
  • @yan yes, that would be enough to track that branch. To check who tracks what: `git branch -avvv`. – VonC Nov 20 '14 at 09:19