Linked Questions
35 questions linked to/from Why do I have to "git push --set-upstream origin <branch>"?
5832 votes
21 answers
6.8m views
How do I push a new local branch to a remote Git repository and track it too?
How do I: Create a local branch from another branch (via git branch or git checkout -b). Push the local branch to the remote repository (i.e. publish), but make it trackable so that git pull and git ...
2076 votes
25 answers
1.4m views
How can I avoid having to do "git branch --set-upstream", and instead default to automatically setup remote tracking?
I create a new branch in Git: git branch my_branch Push it: git push origin my_branch Now say someone made some changes on the server and I want to pull from origin/my_branch. I do: git pull But I ...
900 votes
17 answers
471k views
How can I pull/push from multiple remote locations?
The short: is there a way to have a git repo push to and pull from a list of remote repos (rather than a single "origin")? The long: I often have a situation when I'm developing an app in multiple ...
608 votes
6 answers
860k views
When doing a 'git push', what does '--set-upstream' do?
What does git --set-upstream do? I tried to understand it by reading the git manual, but I didn't quite get it.
244 votes
8 answers
292k views
Why call git branch --unset-upstream to fixup?
I'm more of a novice when it comes to advanced operations in git. I maintain my blog using the blogging framework Octopress. Though Octopress is not under any development since 2011, it serves my ...
207 votes
8 answers
218k views
Why do I need to explicitly push a new branch?
I am new in git and I am practicing. I created a local branch but I saw that when I did git push my branch was not uploaded to the repository. I had to actually do: git push -u origin --all. Why is ...
0 votes
2 answers
8k views
Github creating new branch [closed]
For an interview I was asked to refactor an existing project. From the github repository I was given, I was told to: Create a new branch, make updates, commit changes, push to new branch. Then I was ...
6 votes
2 answers
5k views
How can I have 2 independent local Git branches off same remote branch
I have a master branch and am working on 2 features which involve the same files. I want to have 2 local branches pointing to the same upstream master but have different changes. I don't want to ...
1 vote
2 answers
4k views
Git: push was executed with `--set-upstream origin master` to not empty repo
I a very very beginner with git. I've read that git push --set-upstream origin master must be executed only once - when repo is empty. However, I forgot and pushed with --set-upstream origin master ...
0 votes
3 answers
2k views
How do I backup my project with git?
I want to backup my project, so I have tried initializing a rep with git init and then commit all files with git add . git commit -am "first commit" and now I want to push it to a repository (which ...
1 vote
1 answer
3k views
Git: i forgot create branch master, how i can create it if my repository already has another branch?
I got an issue with my repository but i have no solution to resolve it. Please correct me. I created a repository on bitbucket, cloned it and got message "You appear to have cloned an empty ...
2 votes
1 answer
3k views
Why do local commits appearing after git pull?
Before pulling from remote, I'm always making sure that I don't have local commits to avoid conflicts. However, I have experienced this: admin@localhost ~/home (master) $ git status # On branch ...
6 votes
2 answers
1k views
Undo set-branches on git remote
I've currently set up my git remote to restrict which branches are fetched: git remote set-branches myOrigin myBranch This adds the proper entries to .git/config: [remote "myOrigin"] fetch = +...
2 votes
1 answer
2k views
Reconnect git local to GitHub remote without losing a new local branch and commits
With some help I managed to recover a local git project from a fatal: not a git repository (or any of the parent directories): .git issue... Why does git not recognise my local repository? But now my ...
2 votes
2 answers
3k views
How to use git branch patterns?
When performing a git checkout on, for example, the Linux kernel tree to get a specific branch, I am using a pattern: git checkout rpi-4.19.y This branch corresponds to a kernel tree for Raspberry Pi ...