Tag: git branch

Make a git-alias or similar that includes “branchfolder/” – part of the branch name

I just recently discovered how to make git aliases, which are great, but I was wondering if there is a way to include my common branch prefix with the alias. So what I would like is something like: Alias in .gitconfig: [alias] br = checkout -b branchfolder/ and then beeing able to use the command […]

Properly separating two partially overlapping git branches

To work on an issue related to a feature currently under development, a collaborator on a project created a new issue-1 branch off of the feature branch using the GitHub Desktop application. Then they added a bunch of commits to the issue-1 branch. Something went wrong when the branch was created, and now the commit […]

Pushing a branch to a private repo

I’m commenting some code and adding things like requirements files to it. I’ve cloned the repo, branched to a “documenting” branch, completed my documentation and am trying to push to the remote using: git push origin documenting I get an error: ==> git push origin documenting remote: Repository not found. fatal: repository ‘https://myurl/myrepo.git/’ not found […]

Add modified files to a remote branch not yet pulled

If I have some files modified in my git tree and I want to add them to a remote branch that I know it exists but have not pulled in yet. Besides doing git stash and git pull and then using the new branch is there another way?

How can I merge 2 git repositories?

I have two git repositories, say project1 and project2, and project2 is located in a subfolder of project1 : /project1/.git (with contents of project2/ ignored) /project1/project2/.git I would like to know how I can merge project2 into project1, with the same folder structure, but keeping the history of project2 ? I there a simple solution […]

What's a good process for managing persistent codelines in git?

I maintain three codelines for each project: ‘master’ for latest development, ‘test’ for stabilization, and ‘prod’ for live code, plus any feature branches. Periodically, I want to reflect all of the changes from one branch into another. Of course, pushing master into test to begin stabilizing for a new release. Or pushing test into prod […]

Merging changes from a branch based off a topic branch to a different topic branch in git

My team is working on a shared topic branch in git which I will call “topic1.” I was working on a refactor of some code on a branch made off of topic1, which I will call “refactor.” I have been periodically merging topic1 into refactor so I can stay up to date with changes, but […]

Git oddity with folders between branches

I am working with git, still fairly new to working with branches, and I am coming across a real odd problem. I am not sure what is going on to be honest. I am creating a git repo then adding a readme to it, and committing the changes. git init git touch README git add […]

How should I handle database schema changes when switching branches in Rails?

Currently I’m working on a Rails project, where I keep on constantly switching between the deployable master branch, and then many other branches, where I implement new features. The problem is, that usually these features add some tables to the database, which means every time I switch a branch, I have to drop the database, […]

How to move a subdirectory from a branch in one git repository to a branch in a different repository, preserving history?

I’ve got a directory containing utility libraries that were developed in a branch in one git repository, but it turns out they really belong in a different directory in a different project. I’ve read through and attempted Greg Bayer’s Moving Files from one Git Repository to Another, Preserving History multiple times, but I’m unable to […]

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