I am using 'git' to checkout chromium code by following this document: http://code.google.com/p/chromium/wiki/UsingGit
And it said 'Run git pull or whichever command is appropriate to update your checkout. '.
But the problem I run into is when I have local changes in my git working directory and then I run 'git pull'. It said something like XXX file can't get update (I made a change locally). I force 'git pull' to work by removing my change 'git checkout -- XXX.cpp'
Is there a way to get 'git pull' to merge automatically if possible (the svn update equivalent)?
Thank you.
The git pull command is used to fetch and download content from a remote repository and immediately update the local repository to match that content. Merging remote upstream changes into your local repository is a common task in Git-based collaboration work flows.
To sum it up, clone is for fetching repositories you don't have, checkout is for switching between branches in a repository you already have. Note: for those who have a SVN/CVS background and new to Git, the equivalent of git clone in SVN/CVS is checkout . The same wording of different terms is often confusing.
Git SVN is a feature in Git that allows changes to move between a Subversion and a Git repository. Git SVN is a good feature to use if you need to allow changes to go between Git and SVN repositories.
If you want a pull to merge with changes you have made locally, you will need to commit your changes to your local directory first. Or, stash your changes, then pull, then re-apply your stash.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With