Hoppa till innehållet

Ämne på Diskussion:Developer guidelines

Don't store Github repos in Dropbox - possibly causing this problem?

3
Mattias Östmar (WMSE) (diskussionbidrag)

I've stored my repos in Dropbox out of ignorance. Now I have the following situation:

I got a Dropbox "conflict copy" of my main script file in the repo ("create_infotexts.py (Konfliktkopia för Mattiass MacBook Air 2017-04-05")

I deleted the conflict copy (since I'm somewhat a cowboy)

On Github I have a branch `places_from_desc`.

If I do `git pull origin places_from_desc` the branch is not pulled to my local. I still see this for `git branch`.

Can the file conflict have created this non-existing relation to the actual branch on github?

~/Dropbox/wmse/SMVK/SMVK-Cypern_2017-01[master ?*]$ git branch

warning: ignoring ref with broken name refs/heads/master (Konfliktkopia för Mattiass MacBook Air 2017-04-05)

  depicted_people_logic

  enrich_description

  image_class

* master

  output_to_json_blob

Alicia Fagerving (WMSE) (diskussionbidrag)

Honestly, when I get into problems like these, I just burn the local files with fire and download a clean copy from Github.

BUT I still use Dropbox since it syncs the files I don't track on git, like reports, logs and notes, which I probably shouldn't be keeping in the relevant dirs anyway... But it's nice to have access to them.

Mattias Östmar (WMSE) (diskussionbidrag)

Ah. I shouldn't have used git pull since that is actually both fetching and merging the branch into master (where I am standing). I should have used just git fetch origin places_from_desc.

To fix I run git reflog show to see the pretty git names of each event and select the HEAD(a){1}

I then ran git reset HEAD(a){1}

Did this actually undo the merge? Help wanted! See result here:

https://phabricator.wikimedia.org/M212

To get a local copy of the remote branch i then ran:

git fetch origin

git checkout --track origin/places_from_description

Now I can work on the branch again locally. Nothing do do with storing the repo i Dropbox obviously.