开发者

Git Remote Repository Check-Out Problem

I've just started using Git and have never used a versioning system before. I am trying to setup a git repository on my web server and one on my local computer.

I am doing the following on the server (I run the commands in a project folder ~/project):

git init
git add .
git commit -am "Initial Commit"

Then on my laptop i'm using:

git init
git remote add remote_server ssh://[name]@[server].com/~/project
git fetch remote_server

When i've done that the following is displayed

remote: Counting objects: 4, done.
remote: Total 4 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (4/4), 开发者_StackOverflow中文版done.

However, once this is completed there is nothing in the local folder and if I check the log I get:

fatal: bad default revision 'HEAD'

Any help would be greatly appreciated

Thanks


git fetch will fetch the remote branches but not merge them into your local branch(es). You can either:

  • use git clone in the first place, that will place all the changes on your local default branch automatically.
  • use git merge remote_server master to now manually merge the changes into your currently checked out branch (master).
  • use git pull which performs a git fetch followed by a git merge.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜