Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3609188
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:35:43+00:00 2026-05-18T21:35:43+00:00

I really like git. At least, I like the idea of git. Being able

  • 0

I really like git. At least, I like the idea of git. Being able to checkout my master project as a separate branch where I can change whatever I want without risk of screwing everything else up is awesome. But it’s not working.

Basically, my workflow is like this:

  1. Checkout stable version to a new branch to experiment with new code
  2. Make a bunch of changes – I have no intent on keeping any of this, I’m just experimenting.
  3. Look at all the stuff I changed
  4. Add all the changes to be tracked
  5. Commit the branch and push branch to origin (if it worked, otherwise skip this step)
  6. Decide to try another method, go back to master
  7. Observe artifacts from the experimental branch I was working in, even though I’m in the master branch.

Every time I checkout a branch to another branch, make changes to the one branch, and then checkout the original branch, I still have all the files and changes that happened in the other branch. This is getting extremely frustrating. I’ve read that this can happen when you have files open in the IDE while doing this, but I’ve been pretty careful about that and both closed the files in the IDE, closed the IDE, and shut down my rails server before switching branches, and this still happens. Also, running ‘git clean -f’ either deletes everything that happened after some arbitrary commit (and randomly, at that), or, as in the latest case, didn’t change anything back to its original state.

I thought I was using git correctly, but at this point, I’m at my wit’s end here. I’m trying to work with a bunch of experimental code using a stable version of my project, but I keep having to manually track down and fix all the changes I made. Any ideas or suggestions?

git checkout -b photo_tagging
git branch # to make sure it's right
# make a bunch of changes, creations, etc
git status # see what's changed since before
git add . # approve of the changes, I guess, since if I do git commit after this, it says no changes
git commit -m 'these are changes I made'

git checkout master
git branch #=> *master

# look at files, tags_controller is still there, added in photo_tagging
# and code added in photo_tagging branch are still there in *master

This seems to happen whether I do a commit or not on the branch.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T21:35:44+00:00Added an answer on May 18, 2026 at 9:35 pm

    Here is an example of how to use git and branches.

    $ git branch
    * master
      organize
    
    $ git branch networking
    $ git checkout networking
    
    $ git branch
      master
    * networking
      organize
    

    Now Master has been updated many times since anyone has done anything on networking

    $ git pull origin networking
    From github.com:dlundquist/Asteroids
     * branch            networking -> FETCH_HEAD
    CONFLICT (rename/delete): Rename src/ServerClientThread.java->src/ServerConnectionThread.java in 92d5b7c4e7c4110803eabf5d5152e7f2a337d722 and deleted in HEAD
    Auto-merging src/Actor.java
    Auto-merging src/Asteroids.java
    CONFLICT (content): Merge conflict in src/Asteroids.java
    Auto-merging src/BasicWeapon.java
    CONFLICT (content): Merge conflict in src/BasicWeapon.java
    CONFLICT (delete/modify): src/DedicatedServer.java deleted in HEAD and modified in 92d5b7c4e7c4110803eabf5d5152e7f2a337d722. Version 92d5b7c4e7c4110803eabf5d5152e7f2a337d722 of src/DedicatedServer.java left in tree.
    Auto-merging src/MainMenu.java
    CONFLICT (content): Merge conflict in src/MainMenu.java
    CONFLICT (delete/modify): src/NetworkClientThread.java deleted in HEAD and modified in 92d5b7c4e7c4110803eabf5d5152e7f2a337d722. Version 92d5b7c4e7c4110803eabf5d5152e7f2a337d722 of src/NetworkClientThread.java left in tree.
    CONFLICT (delete/modify): src/NetworkUpdate.java deleted in HEAD and modified in 92d5b7c4e7c4110803eabf5d5152e7f2a337d722. Version 92d5b7c4e7c4110803eabf5d5152e7f2a337d722 of src/NetworkUpdate.java left in tree.
    Auto-merging src/ScenePanel.java
    CONFLICT (content): Merge conflict in src/ScenePanel.java
    Auto-merging src/Shield.java
    CONFLICT (content): Merge conflict in src/Shield.java
    Auto-merging src/Sprite.java
    Auto-merging src/TripleShotWeapon.java
    Auto-merging src/Weapon.java
    Automatic merge failed; fix conflicts and then commit the result.
    mjolnir:Asteroids Durandal$ git status
    # On branch networking
    # Changes to be committed:
    #
    #   modified:   src/Actor.java
    #   modified:   src/Sprite.java
    #   modified:   src/TripleShotWeapon.java
    #   modified:   src/Weapon.java
    #
    # Unmerged paths:
    #   (use "git add/rm <file>..." as appropriate to mark resolution)
    #
    #   both modified:      src/Asteroids.java
    #   both modified:      src/BasicWeapon.java
    #   deleted by us:      src/DedicatedServer.java
    #   both modified:      src/MainMenu.java
    #   deleted by us:      src/NetworkClientThread.java
    #   deleted by us:      src/NetworkUpdate.java
    #   both modified:      src/ScenePanel.java
    #   added by them:      src/ServerConnectionThread.java
    #   both modified:      src/Shield.java
    

    Woah, git is really mad. It looks like Master is too far ahead of Networking for git to do all the work for me.

    $ git reset --hard networking
    HEAD is now at 20d6ee8 done tweaking game on the main branch.  Fixed a few bugs with the TripleShotWeapon.  Rebalanced the gameMechanics() in Asteroids to increase the difficulty as the levels increase.
    mjolnir:Asteroids Durandal$ git status
    # On branch networking
    nothing to commit (working directory clean)
    

    Ok, now I am “back in time” when networking last pushed to origin. But I really should go back and merge with Master now before I do any work. Other wise it will be even hard to merge.

    Time spent merging files

    $ git add (insert conflict resolved files here)
    $ git commit -a -m "Merged networking with master"
    $ git checkout master
    $ git branch
    * master
      networking
      organize
    

    Now lets apply our changes.

    $ git merge networking
    Already up-to-date.
    

    You might want to do this if you like the “Yeah!”

    $ git merge origin networking
    Already up-to-date. Yeeah!
    

    Push our changes to the world

    $ git push origin master
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd really like to get our host to pull from our Git repository instead
I really like the way gmail has the archive system implemented. I can archive
I'd really like to handle this without monkey-patching but I haven't been able to
I really like DevX components, but they are pretty expensive, maybe anyone knows free
I really like the fact that Microsoft has taken a commitment to bring MVC
I really like Xml for saving data, but when does sqlite/database become the better
I really like how Consolas looks with ClearType enabled but unfortunately it makes everything
I really like the format and type of links from RubyFlow for Ruby related
I really like the Mako templating system that's used in Pylons and a couple
I would really like to see a proportional font IDE, even if I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.