【问题标题】:Git Review of setup [closed]Git审查设置[关闭]
【发布时间】:2013-09-27 19:25:13
【问题描述】:

Git 新手。

我有一个根文件夹,其中包含我想添加到本地 Git 存储库的源代码。

这就是我所做的(我错过了什么吗?)

进入根目录

cd ~/MySource

创建存储库

git init

添加所有内容

git add .

提交所有内容

git commit -m "First commit, hope it works"

没有错误,我们可以开始了吗?我的开发工具内置了 Git,看起来一切正常...

【问题讨论】:

标签: git


【解决方案1】:

是的,您现在已将代码置于版本控制之下。

我强烈建议,如果您是 Git 新手,请通过这个快速诅咒来学习 Git -> Got 15 minutes and want to learn Git?

如果你提交到 Github,你可以设置你的配置

$ git config --global user.name "Your Name"               # Set your Git name     
$ git config --global user.email youremail@gmail.com      # Set your Git email

在版本控制下设置您的代码

$ git init                          # Set up Git on your project    
$ git status                        # See tracked, untracked, and staged files 
$ git add .                         # Add new files to Git    
$ git commit -am "Initial commit"   # Save your project files to Git

提交到 GitHub

$ git remote add origin git@github.com:yourusername/yours.git     # Set up git to push to your Github repository
$ git push -u origin master         # Push your code to Github (sets the upstream the first time)
$ git push                          # Push your code to Github

【讨论】:

    猜你喜欢
    • 2020-10-25
    • 2017-08-04
    • 2013-02-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-03
    相关资源
    最近更新 更多