- Create a local folder and a text file using File Explorer:
- Open File Explorer.
- Right-click, choose “New,” and select “Folder.” Name it.
- Inside the folder, right-click, choose “New” > “Text Document.” Name it and add content.
- Initialize Git in the folder:
- Open Command Prompt in the folder.
- Run:
git init
- Add, commit, and push to GitHub:
git add . git commit -m "Initial commit"
- Create a new repository on GitHub:
- Go to GitHub.
- Log in and click the “+” in the top right.
- Select “New repository,” give it a name, and click “Create repository.”
- Link local and remote repositories:
- Back in Command Prompt:
git remote add origin <github_repository_url> git branch -M main
Replace <github_repository_url> with the URL of your GitHub repository.
- Back in Command Prompt:
- Push changes to GitHub:
git push -u origin main
This sequence creates a local folder, adds a file, initializes Git, creates a remote repository on GitHub, links them, and pushes changes. Adjust as needed.
Leave A Comment