标签:none hub googl microsoft roman bre english layer 选择
基本操作
cd:切换文件路径
ls:ls为linux命令,查看当前目录下的文件夹
首先进行初始化配置:设置仓库人员的用户名和邮箱地址,这一步必不可少(第一次提交代码)。
fnngj@FNNGJ-PC ~/.ssh $ git config --global user.name "username" fnngj@FNNGJ-PC ~/.ssh $ git config --global user.email "user@mail.com"
git提交文件到github
Quick setup — if you’ve done this kind of thing before HTTPS https://github.com/defnngj/project-name.git SSH git@github.com:defnngj/project-name.git …or create a new repository on the command line echo # project-name >> README.md git init git add README.md git commit -m "first commit" git remote add origin git@github.com:defnngj/project-name.git git push -u origin master …or push an existing repository from the command line git remote add origin git@github.com:defnngj/project-name.git git push -u origin master …or import code from another repository You can initialize this repository with code from a Subversion, Mercurial, or TFS project.
fnngj@FNNGJ-PC /d/project-name (master) $ git remote add origin git@github.com:defnngj/project-name.git fnngj@FNNGJ-PC /d/project-name (master) $ git push -u origin master Warning: Permanently added the RSA host key for IP address ‘192.30.252.128‘ to t he list of known hosts. Counting objects: 3, done. Delta compression using up to 4 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 354 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) To git@github.com:defnngj/project-name.git * [new branch] master -> master Branch master set up to track remote branch master from origin.
git remote add origin git@github.com:defnngj/project-name.git
如果是第一次提交项目,这一句非常重要,它会将本地的项目与远程的仓库之间建立接。 这
里选择SSH协议方式进行连接。
git push -u origin master 将本地的项目提交到远程仓库中。
然后就可以在gitbub中看到提交的项目。
标签:none hub googl microsoft roman bre english layer 选择
原文地址:https://www.cnblogs.com/Xdestiny/p/9601788.html