GitHub - IUHEPandML/DataAnalysis GitHub Wiki
First, introduce your email and username to your GitHub account by running:
git config --global user.name "YOUR_USERNAME"
git config --global user.email "YOUR_EMAIL"
- Create a new repository from the GitHub web page of your account.
To authorize GitHub, it is recommended that you set up SSH keys on your PC and add them to your GitHub account.
ssh-keygen -t ed25519 -C "YOUR_EMAIL"
To connect to host github.com the following is usually used
ssh -T [email protected]
If you had some issues or timeout errors it is may be due to the related wifi connection try to change the wifi connection, if still or no other internet source available try the following commands:
ssh -vT [email protected]
ssh -T -p 443 [email protected]
Please see the SSH keys subtitle below for instructions.
After setting up your SSH key as explained, follow the steps below to commit the changes and push them to GitHub:
echo "# test3" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin [email protected]:USERNAME/YOURREPONAME.git
git push -u origin main
-
echo "# test3" >> README.md
: Creates aREADME.md
file with the text "# test3". This is typically done to initialize the repository with a readme file. -
git init
: Initializes a new Git repository in the current directory. This creates a.git
folder to track all changes. -
git add README.md
: Adds theREADME.md
file to the staging area. -
git commit -m "first commit"
: Commits the changes in the staging area with a message "first commit". -
git branch -M main
: Renames the current branch tomain
. -
git remote add origin [email protected]:USERNAME/YOURREPONAME.git
: Adds a remote repository calledorigin
pointing to your GitHub repository. -
git push -u origin main
: Pushes the changes to themain
branch of the remote repository and sets the upstream tracking for themain
branch.
git remote add origin [email protected]:USERNAME/YOURREPONAME.git
git branch -M main
git push -u origin main
-
git remote add origin [email protected]:USERNAME/YOURREPONAME.git
: Adds a remote repository calledorigin
pointing to your GitHub repository. -
git branch -M main
: Renames the current branch tomain
. -
git push -u origin main
: Pushes the changes to themain
branch of the remote repository and sets the upstream tracking for themain
branch.
Replace the placeholders written in capital letters:
- Replace
USERNAME
with your GitHub username. - Replace
YOURREPONAME
with your repository name.
-
Generate an SSH key and add it to the SSH client. Refer to the link: Generate SSH Key and Add to SSH Client.
-
Add the generated SSH key to your GitHub account. Refer to the link: Add SSH Key to GitHub Account.
-
Test your SSH connection with GitHub by following the link: Test SSH Connection.