My github code is added

Source: Internet
Author: User

1. Create a new repository:

echo "# Backupvim" >> readme.mdgit initgit add readme.mdgit commit-m "First commit"https://git Hub.com/fankcoder/xxx.gitgit push-u Origin Master

2. Update the project (new file added):

$CD ~/pywork
$git Add. #这样可以自动判断新加了哪些文件, or manually add the file name
$git Commit #提交到本地仓库
$git Push Origin Master #不是新创建的, no more add to remote
3. Update the project (no new files, only delete or modify the file):
$CD ~/hello-world
$git commit-a #记录删除或修改了哪些文件
$git Push Origin Master #提交到github
4. Ignore some files, such as *.O, etc.:
$CD ~/hello-world
$vim. Gitignore #把文件类型加入到. Gitignore, save
Then you can git Add. can automatically filter this file
5.clone code to Local:
$git Clone [Email protected]:wadeleng/hello-world.git
If the code exists locally, and the repository has updates, merge the changes into the local project:
$git Fetch Origin #获取远程更新
$git Merge Origin/master #把更新的内容合并到本地分支
6. Revocation
$git Reset
7. Delete
$git RM * # is not in RM
#------------------------------Common Errors-----------------------------------
1.$ git remote add origin [email protected]:wadeleng/hello-world.git
error Hint: fatal: The remote already exists origin.
WORKAROUND: $ git Remote RM origin

Then in execution: $ git Remote add origin
Https://github.com/fankcoder/xxx.git
#就不会报错误了
2. $ Git push origin master
error message: Error:push failed
Workaround: Git pull Origin master #先把远程服务器github上面的文件拉先来, then push up.

My github code is added

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.