Editing
Git Cookbook
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Syncing a repo with subsequent changes to the master== Scenario: Create a branch, make edits. In the meantime other work is being done by other members of the team. The time comics to push your changes out. The goal is to merge their changes into yours locally then push it all out. * See what files have been touched: <syntaxhighlight lang="bash"> $ git status -s </syntaxhighlight> * View (unstaged) edits for a specific file: <syntaxhighlight lang="bash"> $ git diff -- [path] </syntaxhighlight> * Switch from the local branch to 'master'. <syntaxhighlight lang="bash"> $ git co master </syntaxhighlight> * Merge the updated local 'master' with the local branch, resolving any conflicts: <syntaxhighlight lang="bash"> $ git branch * master mybranch $ git co mybranch $ git merge master </syntaxhighlight> * See also <code>[http://git-scm.com/book/en/Git-Branching-Rebasing git rebase]</code><br />Which does the same thing as <code>git merge</code> but in a slightly different way that is helpful to maintain a linear set of changes when merging two branches together.
Summary:
Please note that all contributions to Littledamien Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Littledamien Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information