Tag: git-branch

How can I pull from one remote and push to another with git?

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 so that while I’m on branch foo, git pull pulls from contributor/foo and git push pushes […]

How to restrict access to master branch on git

I have a single repo in which I have 2 user groups: Admins HTML/UI Developers I do not wish to give read/write access of my master branch to my HTML developers as they do not need to work on it and should not be misusing the core code. Though they need to work on their […]

Git: how to change active branch on remote repository?

I worked on some code on a local branch and then I pushed it to a remote test repository with this command: git push origin fix_vouchers:fix_vouchers I’d like to change the active brank on that remote repository so that the other developers can test this code. Can I do this from my local environment?

Move uncommitted changes from current branch to another branch that conflicts with those changes

Suppose I am on branch master and I start making some changes. I make the changes to a file which is already opened in Emacs (so under the hood, as checkouts happen, Emacs is unaware unless I revert-buffer constantly). The file did exist in branch other_branch which was intended to be merged into master later […]

Can git figure out that the branch to be merged has obsolete changes?

I am new in git and I am find it hard to wrap my head around the fact that everything is around snapshots/commits and not individual files. So assume that I have a tree in my repository as follows. C4 (HEAD,Master,Origin/Master) * C3 * C2 * C1 Now I branch out from here: B1 (HEAD, […]

Git – move pushed commits to a new branch (rename branch instead of force pushing?)

There is another question that describes my situation almost exactly (Git – Moving Pushed Commits to a Different Branch). The only difference is that the commits that I would like to move are in the Develop branch rather than master (which shouldn’t matter because there’s nothing special about the master branch). Also, we have redmine […]

github Diff Truncated error

While making pull request in github and reviewing changes we got Diff Truncated error as shown below Can anyone help to fix this issue

Git pull reverted commits in master?

A colleague, whom we’ll call Aaron, was assigned to renovate a section of a website as a long-term project. He created a new Git branch, called aaron. All his changes were made on this branch. While he was working, I continued to maintain the site as a whole, committing my changes to master. Eventually, Aaron […]

How to list branches that contain a given commit on a specific repository?

So I’ve read Git: How to find out on which branch tag is? and many other posts and I already know how to use: git branch –contains tag However, I still need to know how to list branches that contain a given commit (or tag) in specific repository. Background I’ve extracted a list of tags […]

Why is “git branch” silent in new repositories?

When you create a new repository and run git branch, it exits silently. For example: $ mkdir /tmp/foo; cd /tmp/foo; git init Initialized empty Git repository in /tmp/foo/.git/ $ git branch Why doesn’t the command provide any output, or show the master branch?

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