1

I have created a FORK from the company's project for my team to work on. For a few weeks we cannot directly merge our code into company's master so I created this fork to work on this for now and branch from it and work ....

so if I do git remote -v this is what I get:

origin http://github.company.com/myUserID/project.git (fetch) origin http://github.company.com/myUserID/project.git (push) upstream http://github.company.com/OurOrg/project.git (fetch) upstream http://github.company.com/OurOrg/project.git (push) 

BUT still I want my FORK not to fall behind the code that others are writing and merging into Master that I forked from. So every morning I want to do this to keep my FORK updated and sync with what is in the Master that I forked from, So I do this:

git pull upstream master git push origin master 

And I think that does the job of syncing my fork and also its remote repo with what is in the Master.

So at this point my fork is up to date, now I want MY BRANCHES that I created from my FORK to be updated too.

So I did this:

git checkout my-branch-name git pull --rebase 

BUT this is the message I get when I wanted to do a git pull --rebase

There is no tracking information for the current branch. Please specify which branch you want to rebase against. See git-pull(1) for details git pull <remote> <branch> If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=<remote>/<branch> my-branch-name 

So now I am not sure what to do for this part.

2 Answers 2

2

You haven't told your branch what to rebase on top of. Try this:

git checkout my-branch-name git rebase master 

This will rebase all the changes in my-branch-name on top of the changes to your local master.

Sign up to request clarification or add additional context in comments.

4 Comments

so this will sync my branch with the FORK? Because I hope my previous commands have synced the FORK with the real Master...now I am hoping this new command will sync the branches of my fork with the FORK that is newly synced.
I'm sorry, but I cant' understand this.
I mean the command the you showed me does it sync the branch with its Fork?
You aren't being clear, and I'm not going to guess at what you mean. You have an upstream repository and a local repository (which is the one that I think you are calling your fork). If you are in your local repository, these commands will put your local branches changes on top of master. This is on your local branch. If you want to push your changes upstream you have to actually push them.
0

On terminal set the following

git branch --set-upstream-to=origin/master master

Comments