新灵空间

I will go wherever god leads me to!

git pull problem solving steps.

在git pull的時候遇到下面的問題:

error: Your local changes to the following files would be overwritten by merge:
init.el
Please, commit your changes or stash them before you can merge.
在網上搜索了下, 發現下面的步驟可以把問題解決掉, 雖然我不知道爲什麼:
git checkout HEAD init.el
git pull
 

Push code to a remote server

1. 如果之前已经有了一个original source, 应该先git remote rm origin

2. set up the remote repository:

 mkdir my_project.git

cd my_project.git
git init --bare
git update-server-info # If planning to serve via HTTP

3. on local machine:

cd my_project

git init
git add *
git commit -m "My initial commit message"
git remote add origin git@example.com:my_project.git
git push -u origin master