How do you get git to always pull from a specific branch?
I'm not a git master, but I have been working with it for some time now, with several different projects. In each project, I always
git clone [repository] and from that point, can always
git pull, so long as I don't have outstanding changes, of course.
Recently, I had to revert to a previous branch, and did so with
git checkout 4f82a29. When I was again ready to pull, I found that I had to set my branch back to master. Now, I can not pull using a straight
git pull but instead, have to specify
git pull origin master, which is annoying, and indicates to me that I don't fully understand what is going on.
What has changed which does not allow me to do a straight
git pull without specifying origin master, and how to I change it back?
-bash-3.1$ cat config
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
url = firstname.lastname@example.org:user/project.git
fetch = refs/heads/*:refs/remotes/origin/*
UPDATE 2: To be clear, I understand that my original method may have been incorrect, but I need to fix this repo so that I can simply use
git pull again. Currently, git pull results in:
-bash-3.1$ git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me either. Please
name which branch you want to merge on the command line and
try again (e.g. 'git pull ').
See git-pull(1) for details on the refspec.
If you often merge with the same branch, you may want to
configure the following variables in your configuration
See git-config(1) for details.
I can tell
git pull which branch to merge, and it works correctly, but
git pull does not work as it did originally before my
I have two different branches of the same software that I work on every day. However, every time I checkout the other branch, my build process can take up to an hour. To solve this, I have just checke
Cordova provides a CLI which allows you add plugins to your project like so: cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-file This adds the latest version of the file pl
Im very new to Git and what I want to do with git within xcode is pull an older revision of my master (not commandline). Is this possible? I've looked in repositories under the organizer and i see all
I am playing with the git show-branch command and have a question regarding the output. When I execute from branch branch git show-branch I get as output: ! [branch] Add branch_file4 * [master] A
I am trying to get the branch name from a given tag. I tried git describe --tag <tag-name> but this doesn't provide me any branch name. I tried using gitk to show to the tags and branch but gitk
I want to override a specific branch that im currently in, in order to override/replace everything from the remote repository server. If i do git pull on that branch i always get a merge conflict beca
Using Git or Mercurial, how would you know when you do a clone or a pull, no one is checking in files (pushing it)? It can be important that: 1) You never know it is in an inconsistent state, so you t
How do you stop tracking a remote branch in Git? I am asking to stop tracking because in my concrete case, I want to delete the local branch, but not the remote one. Deleting the local one and pushing
In git, supposing I have a branch master and a tag 0.0.1, if I do the following: git checkout 0.0.1 git branch -b random-fix # some changes... git checkout master git merge random-fix The branch from
The problem I've had is that my fingers automatically type git push origin master. If I instead am working on new-branch and was meaning to type git push origin new-branch and there are unpushed chang
When working with many projects and branches at the same time, I occasionally do stupid mistake like pulling into the wrong branch. For example being on branch master I did git pull origin dangerous_c
This is a complicated situation, but essentially what has happened here is that our branch has become separated from master. So essentially: A - B - C master \ X - Y - Z feature has turned into: A -
This may or may not be a very dumb idea, but how can you configure a git repository such that any pull that is done automatically fetches the tags from the other repository as well? According to the d
I have a Ruby on Rails app that has two git submodules. I am upgrading Rails from v3 to v4 in the main app and in the two submodules, so I created a rails4 branch for each in which to do the work. The
Using C# How do you remove a specific node from an XMLDocument using XPATH?
Is there a way to see what commits have been pulled in from the remote repository after you do a git pull --rebase? In other words: git pull will show a summary of changed files at the end (like git
If you've named a branch in CVS incorrectly, or the name originally chosen becomes inappropriate, how do you change it to something else? A related question is How do you rename a branch in CVS withou
my friend and I are working on a particular branch of a repository in Github at the same time, however, when I try to push my changes, if he updated the files before I pull and I try to push mines I g
I have 3 branch in my git repo: master, stand and develop. For each feature i create new brach from develop. After feature done, i'll merge it branch into develop (with --no-ff option). For example,
Suppose I have a locol git repo and a remote repo called hub. Also suppose my local repo has branch1, and branch2, where as the remote repo has branch1, branch2, and branch3. If I call git pull hub w
I am a newbie to Git and having trouble understanding how to use Git. I have been using CVS so going through some learning curve for Git. Here is what all I tried Now I had changed only two files Pro
Our company git workflow looks like this: Every team member has there own branch and pulls from and pushes to a main branch called develop. Whenever I go git pull develop git automatically opens up a
On github, if I fork a project, how can I then pull the latest from the original project that I forked? I am essentially creating a duplicate of the forked project, I am assuming this is a manual proc
I am using git while developing VHDL code. I am doing development on a component in a git branch: comp_dev. The component interface does not change, just the code inside the component. Now, this compo
I have created a fork from a project on GitHub. How can I now pull changes from the project that I forked from?
In my current repo I have the following output: $ git branch -a * master remotes/origin/master remotes/public/master I want to delete 'remotes/public/master' from the branch list: $ git branch -d rem
I know how to checkout a specific branch from here, but after having done so (checkout on same branch), I wish to now 'git checkout head' to get back to the latest revision. One way is to git pull fro
I'm able to see my local and remote branches colored differently with the following configuration in my .gitconfig. [color branch] current = bold cyan local = normal remote = bold red In git branch
Someone sent me a pull request. Before I merge it, I want to look at the changes on my machine. How do I do that?
I know there are questions floating around regarding git pull from a specific branch when you provide no explicit branch name, however I am wondering if it's possible to force a pull branch even if th
Problem How do you create a shallow copy with git-svn from a Subversion repository, i.e. how do you pull only the last three revisions? The git clone command can get the last n revisions from a Git re
I've been trying to get data from http://www.webservicex.net/CurrencyConvertor.asmx/ConversionRate?FromCurrency=USD&ToCurrency=GBP I want to be able to use jQuery to extract the data, I've tried $
We were using a build script to automate our publishing process and it was working with SVN but now we are using Git and need to do some command line operations to pull from our remote repository. I w
If someone has deleted the remote branch, is there any way I can pull from the same repository, and get my local branch deleted as well? It would be handy not to have all developers do the manual remo
Is there any way to annotate a branch? It would be nice to be able to do something like: $ git notes add branch-name -m'This branch is for whatever' but that of course is not terribly helpful, since
I have a contributor to my github repository who has a fork and is working on a branch. I want to pull their branch to my own branch and make modifications, but still track theirs. Can I configure git
Let's say I have a private topic branch called develop with 2 commits ahead of master. What does git pull origin master do? Pull everything from the remote master in the local develop and merge it? Pu
I basically want to do: git checkout branchA git checkout -b branchB <commit_id> which creates the new branchB branch from <commit_id> on branchA. Question: I'm getting into details here
I know how to revert to older commits in a Git branch, but how do I revert back to a branch's state dictated by a tag? I envision something like this: git revert -bytag Version 1.0 Revision 1.5 Is
I have a problem with running git pull from a php script on a remote server. I have looked at a lot of different sources to make it work but none works for me. So what have I done so far: Created the
From time to time we can run across issues where we commit a feature branch to our baseline and discover in some situations it can go horribly wrong, so the change needs to be reverted, without losing
When trying to do a git pull I get You have unstaged changes.. When I do a git status it says: nothing to commit (working directory clean). Why? I can do a git reset --hard, then pull, but I don't u
I'd like to delete a remote branch from my central git repository. The usual advice is to do 'git push origin :branchname' or 'git push origin :heads/branchname'. But when I try that, I get this error
I am using Git. I am working on branch-A with uncommitted changes which i do not want to commit now. Lets us say there is a file with name new_file. I want to overwrite the new_file of the branch-A wi
I have to solve some conflict after a git pull. $ git pull CONFLICT (rename/add): Renamed vignette_generator_mashed.h->vision_problem_8.h in 49423dd0d47abe6d839a783b5517bdfd200a202f. vision_problem
I have tried get the change of github repository to one repository bazaar, something like this: bzr merge email@example.com:Author/repository.git is there any way to do this?
Assume I have a topic branch fix-bug-#25 that has diverged from master a couple of commits ago: o--o--o master \ o--o--o bug-fix-#25 On my third commit in bug-fix-#25 I fixed the bug and want to merg
How do I shallow clone a git repository, so that my clone contains only 1 history item, and starts on a specific branch? I know how to do a shallow clone: git clone --depth 1 https://path/to/myrepo.gi
How can I get all the records from the index using Sphinx? Just like a SELECT * FROM index ? I know that I can do something like this in order to get all the records matching a specific keyword: /usr/
In Windows XP: How do you direct traffic to/from a particular site to a specific NIC? For Instance: How do I say, all connections to stackoverflow.com should use my wireless connection, while all othe