Either use git pull, pass everything explicitly to pull command.As we haven’t set any upstream yet, git provides us two options. See, git pull need to know which remote branch it needs to pull data from. Git branch -set-upstream-to =origin/ master If you wish to set tracking information for this branch you can do so with: Please specify which branch you want to merge with. There is no tracking information for the current branch. Remote: Total 6 (delta 0 ), reused 0 (delta 0 ) Remote: Compressing objects: 100% (3/3 ), done. Let’s use pull to fetch data from remote $ git pull # sync data with remote Newbranch new (next fetch will store in remotes/origin )Įverything is fine till now. Master new (next fetch will store in remotes/origin ) $ cd test # move to newly created repo $ git remote add origin /f/Sandbox/gitdemo/myremote/ # add remote $ git remote show origin # print remote * remote origin Initialized empty Git repository in F:/Sandbox/gitdemo/test/.git/ Say, I have created a new repository and added its origin $ git init test # create a new empty repo Remote branch information is retrieved from its upstream. When these commands are used without any conditional arguments, Setting upstream has effect on many commands e.g. Here master branch is tracking origin/master. Used to print the remote tracking branch. Local branch A and its upstream is set to origin/B, then every push will push the changes to origin/B etc. Every local branch has exactly one upstream set. Upstream is the name of remote branch to which our local branch is synced. To push the current branch and set the remote as upstream, useĮnough is enough, I have searched about it and I am going to write about it. fatal: The current branch master has no upstream branch. Whenever I push my newly created local repository to a remote repo, I am prompted with this message.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |