https://github.com/luciaheredia/pushdirectoryfromlinuxshell
Guide: Pushing a Directory from Linux Shell to Github
https://github.com/luciaheredia/pushdirectoryfromlinuxshell
directory git git-commit git-init git-push git-repository guide linux linux-shell
Last synced: 2 months ago
JSON representation
Guide: Pushing a Directory from Linux Shell to Github
- Host: GitHub
- URL: https://github.com/luciaheredia/pushdirectoryfromlinuxshell
- Owner: LuciaHeredia
- Created: 2025-01-24T17:38:24.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-01-24T18:39:02.000Z (5 months ago)
- Last Synced: 2025-02-14T11:44:54.483Z (4 months ago)
- Topics: directory, git, git-commit, git-init, git-push, git-repository, guide, linux, linux-shell
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Guide: Pushing a Directory from Linux Shell to Github
1. Create a directory:
```
mkdir
```
2. Go inside the directory:
```
cd
```
3. You can create a README file:
```
touch README.md
```
4. Initializes that directory as a Git repository by creating a **.git** subdirectory that contains all the necessary Git metadata for the repository:
```
git init
```
5. Staging all changes in the current directory for the next commit:
```
git add .
```
6. Commit with a message:
```
git commit -m "your message"
```
7. In your Github account, create a new empty repository and copy the URL.
8. Add the Github repository URL as a remote repository to your local repository(your directory):
```
git remote add origin
```
9. Connect to Github using SSH:
- Generate SSH key:
```
ssh-keygen -t ed25519 -C ".com"
```
- Show and Copy SSH key:
```
cat ~/.ssh/id_ed25519.pub
```
- Put SSH key in your Github account:
- Settings -> SSH keys and GPG keys -> New SSH keys
10. Change the remote URL for your local repository, to **[email protected]**:
(Make sure you have the necessary SSH key set up on GitHub to authenticate with this new URL)
```
git remote set-url origin [email protected]:/.git
```
11. Verify the change:
```
git remote -v
```
12. Push commited changes to Github:
(If **remote-branch-name** already exist, choose a different one)
```
git push -u origin
```*Author*: [LuciaHeredia](https://github.com/LuciaHeredia)