An open API service indexing awesome lists of open source software.

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

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)