将更改推送到git中的裸仓库

时间:2015-04-17 20:36:14

标签: git shell

我有两个git回购。一个包含我修改但未提交的文件,另一个包含没有文件(它是一个裸仓库)。如何将这些更改从修改后的更改推送到裸仓库?我对git和unix相当新,所以任何帮助都会非常感激!

wpz23@tux64-12:~/cs265/lab3-git$ git status
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        new file:   lab3

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   lab3

1 个答案:

答案 0 :(得分:0)

<强>提交

首先,您需要在本地存储库中提交更改。

$ git add lab3
$ git commit

http://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository

添加远程

接下来,您应该将远程存储库作为远程存储库添加到本地存储库。

$ git remote add remote-name http://remote-url.edu

http://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes

<强>推

最后,您应该将提交推送到遥控器。

$ git push remote-name branch-name

http://git-scm.com/docs/git-push