0

it is simple I just do the git checkout branch-name and after 3 seconds my current branch is master again. steps:

  1. git checkout branch-name
  2. wait 3 seconds
  3. git goes back to branch master

I used git config --list to see my credentials and it was correct, the main repo has in bitbucket.

  • What OS are you running? Can you show output? – TheIceBear Sep 17 '20 at 17:18
  • 3
    What are you doing in step 3? I mean, how do you _know_ that "git goes back to branch master"? I'm not saying it's impossible, just want to get a sense of what the phenomenon is. (OK, yes, I'm saying it's impossible. But whatever.) Also, what does this have to do with bitbucket? – matt Sep 17 '20 at 17:26

1 Answers1

1

Obviously : some other process is doing something to your git repository.

If your repo is placed in a synced directory, for example (Onedrive, Google cloud, Dropbox ...), since all your git's state is stored in files, an automatic update of the .git/ folder could (if done in the wrong direction) move back info like the checked out branch, or the stored files ...

If your repo is placed in a shared folder, someone else running actions would also modify what you see.

If a cron job, or a hook triggers some action on your repo, it could switch your active branch back to master.

etc ...

LeGEC
  • 46,477
  • 5
  • 57
  • 104