Tag: branch

Trying to pull down a remote branch that has been deleted locally

I created a branch in git and pushed it to the remote. I then deleted it locally. Now, I want to pull it again so I can work on it locally and make changes. However, when I try to pull it from the remote, it says ‘already up-to-date’ and I do not see it locally. […]

Unable to switch branches. What am I doing wrong?

I’m probably missing something. Kindly point out my mistake. I have a repository. The trunk is called master (obviously) and contains a number of files. I’ve created a branch called dev-17 and added one more file (called file17) to that. Now, on a Debian-based system I do: $ git fetch origin $ git reset –hard […]

Renaming remote branch on git and update log

So the title says it pretty much all. I found an old answer on how to rename remote tags (Rename Git branch folder) but I am worrying my log is going to make no sense after the changes (eg. Is it going to report an inexistent branch merge onto develop?). Is this going to be […]

Custom branch for git

I intend to checkout a custom branch in my project to include some specific features that must not be merged to master. This branch will be maintained independently alongside the main branch. If there are bugs fixed on my branch that I want merge to master without the custom features, what should I do, or […]

List branches not merged to their upstream

I’d like a command similar to git branch that will list all local branches that are not merged with their upstream. This is something git branch knows about, as git branch -d <branch-name> will fail for branches that are not merged.

Merging strategy with a long development branch. How to prevent heavy conflicts in the future merge?

I’m developing a project where I constantly want to make small improvements on master branch and push them to production. I have problem because I want to concurrently work on a branch that will be pushed only after a long time. If I will use different branches on long_project and not merge them immediately, one […]

Push local commits on master branch to new remote branch

I have local commits on the master branch, but (due to unforeseen external reasons) I now can’t push my changes to master and instead need to push them to a new remote branch (that can be merged back to master later). How do I (safely) do that?

Why changes in one branch can affect the other branch in git?

I was at master branch, I commit everything then I create a new branch “git checkout -b xxx” then I switch back to master “git checkout master” then I delete everything with master branch without using “git rm” I checkouted to branch xxx, during the branch switching, it shows a long list that every file […]

No git trees, why?

I’m new with git and I don’t understand one thing. I create a repository and a master branch. I made an initial commit with lot of files. I created a branch “development“. And from development branch a new branch for a new project. I made some commit, push. But all my git history is flat. […]

Git rebase patches file in the wrong place

I am unsure whether this is the intended and known operation of git rebase or if I’ve found an issue. I have replicated it in a public repository using lorem ipsum. (https://github.com/drewclauson/git-rebase-example) The issue occurs when I have two sections of code that are exactly the same for several lines (see lorem ipsum.txt). Ideally, the […]

Git Baby is a git and github fan, let's start git clone.