Using git pull
used to pull from the remote repository as expected - now, it's asking me to use git pull origin master
. I don't quite understand the instructions it's giving me, saying I can add something to my configuration file:
[branch "master"] remote = <nickname> merge = <remote-ref> [remote "<nickname>"] url = <url> fetch = <refspec>
Right now my configuration file looks like
[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ignorecase = true [remote "origin"] url = |redacted| fetch = +refs/heads/*:refs/remotes/origin/*
So I'm guessing I need to add
[branch "master"] remote = origin merge = ??
What does "merge" need as its argument? What's a remote-ref(erence?)? I tried looking at http://git-scm.com/docs/git-config but it seems to be more about the command itself.
Thanks in advance!
Remember, a pull is a fetch and a merge. git pull origin master fetches commits from the master branch of the origin remote (into the local origin/master branch), and then it merges origin/master into the branch you currently have checked out.
'git pull origin master' will fetch and update only a specific branch called master and origin in the remote repository. Often, the default branch in Git is a master branch, and it keeps updating frequently. A user can use any branch name to pull that branch from the remote.
There is no command to explicitly undo the git pull command. The alternative is to use git reset, which reverts a repository back to a previous commit.
The behavior is default because it allows you to synchronize the whole repositories at once. If you don't want to update all local branches at once, use git fetch to synchronize the repositories and git merge origin/<branch> to update each single local branch.
try:
[branch "master"] remote = origin merge = refs/heads/master
It should be enough just to execute
git config branch.master.remote origin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With