github - Get changes from one branch into another one in git and how can I work on my own branch -
i'm little lost git, it's first use git other people.
what want bring changes made in branch branch in working, let's when execute git branch --all
see this:
master * c remotes/origin/head -> origin/master remotes/origin/a remotes/origin/master remotes/origin/c
so, i'm working on branch c, , have friend made some changes in branch a, how can bring changes branch?
the other thing not quite understand how can work on own branch, let's suppose fixed in file blah.html.erb, , want commit , upload own branch, ok following?
git remote add blah.html.erb origin/c git commit -m "some changes" git push origin origin/c
greetings.
in order have access friend's branch, first need fetch them remote repository local repository with:
git fetch --all
this pulls branches remote repository don't exist locally , adds them repository. once you've done this, have merge branch branch. assuming you're on branch (if not run git checkout c
), run
git merge
and accept merge commit pops up. far as, "the other thing not quite understand how can work on own branch", think you're misunderstanding basic fundamentals of git, , highly recommend read through the docs give critical knowledge. though, idea git have local repository, has set of data @ given time, , potentially number of remote repositories contain set of data may differ yours depending on when last synced local repo remote repos.
you should run git remote add xxxx
once; when want add remote repository (xxxx) future usage. local repository knows exists (see <your project root>/.git/config
), don't need run again. need is:
- add new file local index:
git add blah.h
- commit file local repository:
git commit -m "some changes"
- push updated branch remote repository:
git push origin c
does make sense? if not, really, need more reading on absolute fundamentals of git. you've made decision start using git, sounds have more digging before you're able use effectively.
Comments
Post a Comment