GithubHelp home page GithubHelp logo

gittutorial's Introduction

GitTutorial

Git全局设置:

  • git config --global user.name "erazhan"
  • git config --global user.email "[email protected]"

git上传文件介绍

  1. github上创建项目
  2. cd <your dir>(其它地方也行,但是后续要切到该文件夹)中右键点击git bash here(如果没有则需要先安装Git)
  3. git init,会多一个.git隐藏文件夹
  4. git remote add origin https://github.com/erazhan/GitTutorial.git (最后可根据具体仓库地址更改即可)
  5. git pull [--rebase] origin <your branch or tag>,作用是将github上的仓库pull到本地文件夹,注意[--rebase]不要轻易使用,适用于代码非首次提交
  6. 将需要上传的代码文件,复制到目标文件夹
  7. git add .(上传所有文件)或者git add <your update file>(上传单独的文件)
  8. git commit -m '文件描述,一般用first commit,init等都可以'
  9. git push origin <your branch or tag>将本地仓库推送到远程仓库

branch和tag的使用

  • 创建分支,git branch release/0.0.8

  • 切换分支,git checkout release/0.0.8,或者git checkout -b release/0.0.8直接创建分支并切换

  • 创建本地tag,git tag v0.0.8

  • 删除本地tag,git tag -d v0.0.8

  • 将本地tag上传到远程仓库,git push origin v0.0.8,其实和上传分支一个道理,但不支持更改,更改相当于先删了原有的tag,再重新上传

  • 删除远程tag,git push --delete origin v0.0.8,注意如果执行不了,可以尝试先git pull origin v0.0.8

  • 参考网址

  • git branch介绍

  • git branch使用

  • git tag介绍

备注

  • .gitignore最好在上传文件前进行创建,否则不会忽略已经上传过的文件
  • .git文件保存了当前所有信息

查看github账户信息

github获取personal assess token

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/erazhan/CommonTools.git/'

2021年8月13后,git上传更新项目文件时输入账号密码,不再用github的登录密码(password authentication),改用个人token(personal assess tokens)。

gittutorial's People

Contributors

erazhan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.