Using Emacs/Magit, I had first a very smooth git experience in another project, but in my actual project I'm confused by all the branches and annoyed by the not tracked #file.ext# that pop up al the time. Here is how it looks:
a4cc383 master [remotes//master]
e08a624 origin-master [remotes/origin/master]
6a64828 tj-branch
a4cc383 remotes/origin/master
What I planned to do is to work on my personal branch (tj-branch), commit, then merge with master, then push to the remote repository. But I have too many master branches for my taste. I would expect origin master to be the tracking branch, and master the local copy of it. But then I would need 2 merges before I can push - isn't the tj-branch redundant then?
What about
a4cc383 remotes/origin/master
Is that a branch too? Why does it exists, why do I need it?
My questions:
which branches do I really need, which can be deleted?
from my local branch - which master do I have to checkout, then merge with, to push my changes: master or origin-master?
when I try to change branches, I'm often asked to save open emacs buffers and then told 'file has changed on disk, do you really want to change', and its very confusing because I don't know sometimes which one is the new version - on disk or the buffer. Where is this problem coming from?
Sorry for the rather noob question, I read some good tutorials about git, but still don't get my heasd around the master branches.
pls find answer as follows:
which branches do I really need, which can be deleted?
Now, I see the following branches from your logs:
Actually, you can go into your .git folder, and cd refs, in this folder, your local branch will in the refs/heads/....., you remote branch should be here: refs/remotes/origin/xxx
from my local branch - which master do I have to checkout, then merge with, to push my changes: master or origin-master?
You can checkout your topic from master, do some change, commit them, git checkout master, and git merge your changes, after this, push your change like this, git push origin[the default name of your remote repo] master[local branch]:master[remote branch]// git is so clever.
when I try to change branches, I'm often asked to save open emacs buffers and then told 'file has changed on disk, do you really want to change', and its very confusing because I don't know sometimes which one is the new version - on disk or the buffer. Where is this problem coming from?
You must commit your local changes before checkout, if you do not want to commit, you can use git stash //this will keep you change, if you want to restore it, you can use git stash apply
Hope this is helpful for you.
Br, Tim