Tag: branch

Git: can't switch to new remote branch

I have an account on github and I use it from two different machines. On one, I created a new branch myNewBranch and switched to it. Then I did my modifications to my code, I committed and pushed to myNewBranch. On the second machine, I can’t figure out how to push to it. $ git […]

Where are the Git branches stored?

I’m working on a website and constantly switching from development mode (where the code has every URL in it pointing to localhost, the database is named “project”, the user “root”, empty password, etc.) to production mode (where everything set to work in my hosting, real passwords, real URLs, etc.) and I just recently started to […]

How to switch branches in eclipse without commiting changes

I’ve been using GIT for a couple of weeks now and trying to understand how to switch branches without commiting files. This is what I have done. Cloned a git repository and have a local master branch. Created a new local branch (Branch2) which is based on a remote branch. Made changes to 2 files […]

Make a git branch equal to master again

Short version What is the easiest way to make a branch equal to master again, discarding any differences? Up until now, I simply used git branch -D wip, followed by git checkout -b wip, but that seems a bit silly. Motivation I often have a wip branch alongside my master branch, for ‘work in progress’. […]

Git add branch on one single directory?

I have a git repository on GitHub, with 3 different folders and only the master branch. How can i create a new branch on one single directory instead of all the three?

Use merge or rebase to maintain a deployment branch

I host with AWS which means I cant use environment variables to control my production and staging deployments. I am therefore forced to use separate branches for deployment, and am wondering if there is a best practice approach towards their maintenance? If I merge changes into my production branch, the commit that contains my production […]

Git: How can I merge changes made between two tags to another branch?

I’m trying to manage our Moodle instance on our own branch of the Moodle repo. I checked out tag “v1.9.11” of branch “MOODLE_19_STABLE”, then copied that to a new branch “COE”, where I’ve added in our custom theme, etc. Now that tag “v1.9.12” exists, I want to merge the commits up to that tag into […]

Branch does not exist

the command git branch –set-upstream-to develop origin/develop results in the error fatal: branch ‘origin/develop’ does not exist I am not sure what this means other than origin develop does not exist. Does that mean it doesn’t exist on the server or on my local machine? I am a git newbie but I am in the […]

Git: Deny deleting remote branch via push (like receive.denyDeletes), but only if branch is not fully merged

Git will by default deny deleting a local branch (via git branch -d mybranch), if that branch is not fully merged. However, if I delete a remote branch via git push origin –delete mybranch, there is no warning whatsoever if the branch is not fully merged. This seems rather dangerous: Someone else might have pushed […]

How to allow per user protected branches access in GitLab?

GitLab allow me create protected branches and then specified witch users will have push access to those protected branches. But what about if I want some users access to some, but not all protected branches on the same repo? I mean, a more discrete/granulated user-branch permissions.

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