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 AnyName
% git config --global AnyAddress

% git config --global core.editor emacs

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

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 "")

% 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 details

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