How to use git and GitHub

GitHub is the software platform. We used GitHub and shared the code.

Create an account for GitHub

Initial settings of git

Register user name and address name on the terminal.Type any name and address for AnyName and AnyAddress.

% git config --global user.name AnyName
% git config --global user.email AnyAddress

% git config --global core.editor emacs

Now, when you edit a message in Git, Emacs starts, regardless of your shell's default editor.

https://git-scm.com/book/ja/v2/Git-%E3%81%AE%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%9E%E3%82%A4%E3%82%BA-Git-%E3%81%AE%E8%A8%AD%E5%AE%9A

If you want to check it, type the following command.

% git config --list

Clone the repository

Get source code from an already existing remote repository.

To do so, type the following command.Type

Copy the desired data in the existing remote repository (GitHub) to your PC.

In HTTP, copy and paste "Clone with HTTPS" of green "code" from the data folder page of github

% git clone HTTP

The data folder you copied on your PC is the local repository.

Change and reflect the data to the remote repository are done in the local repository.

The following is the procedure for reflecting data to the remote repository.

The command used to add files or directories to the index.

In FILE, enter the changed file name that you want to reflect the data (Eg "hello.py")

% git add FILE

Command used to write changes to indexed files and folders to the repository.

Enter any message in MESSAGE. (Eg "add new file")

% git commit -m "MESSAGE"

Reflect the changed data to the remote repository (GitHub).

% git push

At this time, the github user name password is asked, so enter it.

See this site for detailshttps://techacademy.jp/magazine/6235

KAGRA/Subgroups/MIF/Simulation/KamikokaActivity20200817/how_to_use_git_and_github (last edited 2020-08-25 10:04:28 by chiaki.hirose)