Install and use git on Windows to gitoschina and github Develop Paper

Install and use git on Windows to gitoschina and github Develop Paper

  1. Git introduction and installation on windows
  2. create sshkey
  3. Use in Gitoschina
[ Git introduction and installation on windows ]

Git is a free, open source distributed version control system for agile and efficient handling of any project, small or large.
For related introduction, you can refer to the description of <Baidu Encyclopedia>,
or refer to the good information of Liao Xuefeng: http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/001373962845513aefd77a99f4145f0a2c7a 7ca057e7570000

Install git under Windows:
Refer to Liao Xuefeng’s information: http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/00137396287703354d8c6c01c904c7d9ff056ae23da865a0 00

Refer to gitOSchina help: http://git.mydoc.io/?t=83143

Official download git installation software: https://git-scm.com/downloads
or Liao Xuefeng information: https://git-for-windows.github.io/
Installing git software under windows is very simple, basically the next step, you can Select the corresponding installation path.
After the installation is complete, find "Git" -> "Git Bash" in the start menu, and something similar to a command line window pops up, indicating that Git is installed successfully!
The last step is to set the name and email address, enter on the command line:

git config --global user.name "window_beyond"  #你的名字或昵称
git config --global user.email "[email protected]"  #你的邮箱
git config --global core.editor vim         #设置编辑器为vim
Create SSHkey

Reference: http://jingyan.baidu.com/article/a65957f4e91ccf24e77f9b11.html

$ cd ~/.ssh  #在用户主目录下,看看有没有.ssh目录,如果有,再看看这个目录下有没有id_rsa和id_rsa.pub这两个文件,如果已经有了,可直接跳到下一步。
$ cd ~  #保证当前路径在主目录下
$ ssh-keygen -t rsa -C "[email protected]"  #一路回车,使用默认值即可
$ cat ~/.ssh/id_rsa.pub  #复制内容

Log in to the GitHub system; click the "▼" of the account avatar in the upper right corner→Settings→SSH and GPG kyes -->New SSH key to add the copied content

$ ssh -T [email protected]     #ssh第一次连接需要输入yes  
出现 Hi beyondyinjl! You've successfully authenticated..... 表示配置成功

Log in to the git oschina system; personal data –> SSH public key to add the copied content

$ ssh -T [email protected]     #ssh第一次连接需要输入yes  
出现 Welcome to Git@OSC, beyondyinjl! 表示配置成功
Used in Gitoschina

Find "Git" -> "Git Bash" in the start menu

$ cd e:
$ mkdir gitoschina
$ cd gitoschina/
$ pwd
     #$ git init  #把当前目录初始化一个空的仓库,后续讲.这里我使用clone一个已经存在的远程仓库
$ git clone [email protected]:beyondyinjl/maven-repository.git 
#因为已经添加了SSH key,所以使用ssh地址传输,以https传输也可以,但每次要输入用户名和密码.
    登录 http://git.oschina.net/beyondyinjl/maven-repository项目下有HTTPS or SSH两种方式选择.
$ cd maven-repository #项目下的内容都下载下来了

See the common-tool-validation project for pom.xml configuration in maven

    <distributionManagement>
        <repository>
            <id>tool-maven-repository</id>
            <name>Internal Repository</name>
            <url>file:e:/gitoschina/maven-repository/releases</url>
            <!-- <url>file://${project.basedir}/../../gitoschina-repo/maven-repository/releases</url> -->
            <!-- maven打jar包的路径 -->
        </repository>
    </distributionManagement>

mvn clean deploy uses maven to make the jar package to the maven-repository directory and submit it to the remote warehouse

git add --all
git commit -m "validation"
git push

Submit to private warehouse: http://git.oschina.net/beyondyinjl/maven-repository

oschina new project


Create a common-tool-validation project git.oschina.net under the organization javaRepository Organization javaRepository –> create a project: common-tool-validation

cd common-tool-validation
git init
ls
git add pom.xml readme.md src/*
git commit -m "first commit"
git remote add origin [email protected]:javaRepository/common-tool-validation.git
git push -u origin master  #提交到git.oschina上

Guess you like

Origin blog.csdn.net/yinjl123/article/details/131988784