Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

a 'git pull' command works like 'svn update'?

Tags:

git

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.

like image 883
n179911 Avatar asked Aug 21 '09 02:08

n179911


People also ask

What does a git pull do?

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.

Is git clone same as SVN checkout?

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.

What is git SVN command?

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.


1 Answers

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.

like image 149
William Pursell Avatar answered Sep 22 '22 08:09

William Pursell