Git undoes changes from remote branch unintentionally
We've got what I think is a typical git setup, with an "origin" repository that multiple users, each with their own repositories, fetch and push to, and each user manages their own branches, and then merges to the master branch.
However, a commit and a push from a user has resulted in changes from another user being undone: both users had modified the same files, and I wanted, and expected, that these changes would be merged together, and I'm fairly sure this commit didn't show anything to do with conflicts.
I'm not sure how to investigate what happened, let alone how to prevent this from happening again. How can I find out what happened, and what could be done to prevent it in the future?
Edit: from @antak 's answer requesting clarification, the changes are "undone" not from a delete of the commit from the history, but what looks like, from a git show, that they manually removed they changes (but they didn't do this deliberately).
After I did a clone of a repo, a new branch test has been added to the origin remote. But I still see: $ git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/master What git
I know enough of git to be dangerous. I am working on frameworks/base git of android repo. I changed to a branch p/androidopt. This branch has remote tracking branch vsg/p/androidopt. Later I made cha
This question already has an answer here: Move existing, uncommited work to a new branch in Git 1 answer I've been editing some modules on the master branch but I haven't committed them. I'm no
I'm trying to pull code from my GitHub repo onto my server, but the pull keeps failing because of merge conflicts. I don't want to keep any of the changes that may have occurred on my local server sin
I am using EGit 2.1.0 in eclipse juno. On a repository I right-click the origin/master branch in the Remote Tracking folder and create a new branch: Source ref: refs/remotes/origin/master Branch name:
I'm trying to fetch a remote branch onto my machine without any local changes. For exmaple, if the two repositories look like this: Remote: master: A -> B -> C -> D Local: master: A -> B
I finished to commit and push changes on remote git repository but when I view remote repository's files, these are outdated. I'm using Git Bash. View image The red text are changes made in repositori
So I had a changes to a bunch of files, and then created a new branch and pushed them to a new remote branch as follows: git status # lots of changes listed git checkout -b new-branch git add . git co
I need to recover two Git branches that I somehow deleted during a push. These two branches were created on a different system and then pushed to my shared (github) repository. On my system, I (appa
I am wanting to bring a newly added remote branch into my local repository without interfering with my local branches. Is this possible? When I do: git branch -a The new remote branch doesn't appear
I have got a repository at github and several branches. The whole repo is about 2 gigs. Before moving to git, I had an ant script that would checkout a folder from svn repository, build binary files a
In my repository I have a branch called aq which I'm working on. I then committed new work and bugs in master. What is the best way to get those commits into the aq branch? Create another new branch
I created a local branch which I want to 'push' upstream. There is a similar question here on Stack Overflow on how to track a newly created remote branch. However, my workflow is slightly different.
Possible Duplicates: How do I push amended commit to the remote git repo? Undoing a git push Hi, I've deleted some commits from my master branch by using git reset --hard SHA_VALUE I have, however
I have pulled all remote branches via git fetch --all. I can see the branch I'd like to merge via git branch -a as remotes/origin/branchname. Problem is its not accessible. I can't merge or checkout?
I have a tag called latest and I want that to be a branch instead. Opposite of this. I need to remove it from the remote repo as well. Background: This is currently a problem for many golang packages,
When branch B does not exist locally, but is on the remote repo, git branch * A git branch -a * A remotes/origin/B How can i pull B to my local repo? Should i git checkout B first? Should i pull, wh
When I run git push, my local branch some_branch is pushed to a remote branch some_remote\some_branch. When I run git remote show some_remote I get: Local refs configured for 'git push': [cut] some_
I cloned something from git repository, and switched branch git clone ssh://126.96.36.199:23211/dir1/dir2 dir git branch branch1 I did some modification in my local, and committed it. And somebody else
Basic question but this happens to me all the time: Make changes in a working-branch Switch to master git merge working-branch git push cap deploy(to staging) make a new cup of tea then I come
I am currently on (no branch) with uncommitted changes. I would like to check out a different branch and throw away all my changes. When I do git checkout <branch_name> I get: **error: Your lo
I want to check a local branch currently tracking which remote branch For example: git checkout -b test_branch git branch --set-upstream test_branch origin/remote_project001 But after a few days, I
I've been working on a local clone of a remote git repository, committing my changes to my local master branch. Now, I want to push my commits to the remote repository. However, I want to keep my loca
I cut the history of my master branch into an old_stuff branch, via the advice of this Q&A: How do I remove the old history from a git repository? . To save you a click-through, the process involv
I created and switched to a new branch and made some changes that haven't been commited. How do I return to the state of my last commit? I used git reset --hard HEAD but all the changed files are sti
Usually when I do git pull or git status it automatically fetches and merge the data from the remote branch, and show the local commits that can be pushed on that branch. A new branch have been create
I'm developing an iPhone application with another developer. Our git repository is situated on the remote server. So we are working with our working copies and then we do commit, pull, push one by one
The following command: $ git branch -a yields * develop master remotes/origin/HEAD -> origin/develop remotes/origin/develop remotes/origin/feature/foo remotes/origin/master but I don't want remote
I want to do something similar to git rebase but without collapsing parallel commits. Let's say I have the following commits: B (bar) / A-C-D (foo) Now I want to take the changes that D introduced t
I made changes in my working directory and did a 'git commit' And then I do a 'git pull'. Git tries to pull changes in the remote tracking branch and automatically merge it for me. But there are some
I'm getting crazy with Git :) I have 2 branches : master and dev I want to create a feature branch from the dev branch Currently On branch dev, I do : $ git checkout -b myfeature dev ... (some work
Most examples of creating remote branches involve pushing from a local branch Is there a way of creating an empty remote branch without pushing? Is it also possible to create a local empty branch,chec
I tried creating remote branch devel using: git push origin origin:refs/heads/devel But it fails with: error: src refspec devel does not match any. error: failed to push some refs to 'git@***.com:**
I have a remote project that have a branch. So I first clone the repo. Then issue the following to the clone to work on a branch: git checkout -b <name> <remote_branch_name> Then I made t
I have multiple lab machines and I need to make a copy of my remote branch on my local lab machine. I believe the git bash command for this is: git checkout -b mybranch origin/mybranch How do I do t
In git, supposing I have a branch master and a tag 0.0.1, if I do the following: git checkout 0.0.1 git branch -b random-fix # some changes... git checkout master git merge random-fix The branch from
I have a local branch which is a new branch called A. I want to push it to the remote, but I want it to be named differently in the remote. For example, remote name would be users/me/A but in local,
I've done something incredibily stupid. I figured I should ask before I tried to fix it and accidentally make things worse. I tried to list all remote branches in my git repo: git branch remote Obv
I'm using git as an interface to an SVN repository. Now I've created a SVN branch: git svn branch my_branch This created the directory in my SVN repository, and also created a branch called remotes/m
I've accidentally unhitched my master branch from tracking origin master I think. It used to be that I could run git pull and git push and it would know that I meant git push origin master but now it
Scenario: Local git repo, default master branch FTP server with content of the repo (non git), synchronized daily with the local repo, master branch Workflow: user1 is working on local git repo (gi
master branch has these files and folders (simplified): C:\Local\TickZoom\Project>ls file.txt name.txt public public branch is tracking a vendor repository and has been subtree merged as public fo
I am on a repo on github. I have one local branch called : master and on the remote repo there are two branches, branch1 and branch2. I cloned the repo from the branch1. But then, I wanted to pull bra
I have a repo that's forked from a remote repository. I made some changes, the remote repository updated and now I want to pull in all changes from the remote repository, and not care about anything i
I want to know if there is a way on the git command line to copy the branch history from a remote repo. In other words, I want to copy the .git/logs directory from the remote to my .git/logs directory
My local git repo needs to pull from one server. It then needs to push a specific branch to a review repo with a different branch name on a different server. Something like: Pull everything from PullO
I am currently making a project in eclipse.I made changes in head branch and as well as in master branch.I want to merge those changes and push them to remote repository.Please tell me the correct ste
I created a new branch called feature and when I make any changes in this new branch called feature it also gets reflected in the master branch. How can I fix this issue?
I had a remote branch called new_auth. I wanted a new remote branch to track that remote branch, so I did the following: git-remote add -t new_auth -m new_auth pivot email@example.com:myco/my_project.git
I have remote origin with branches a, b and local branch a. I have finished working on local-a, and pushed it to remote-a. I now want to create a local branch b-myUserName based on remote b. How do I