-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from hassanaftab93:work
Edit README.md
- Loading branch information
Showing
1 changed file
with
120 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,132 @@ | ||
# Repository-Automation | ||
|
||
1) I keep my scripts in my root/home folder, in a sub-folder called scripts. I suggest you do the same or similar. To get to the root/home folder, in your terminal type cd ~ because the tilda ( ~ )is the symbol for the home folder. In your Mac Finder app it shows up as the one with a house icon. So all my scripts are stored in ~/scripts | ||
# REPOSITORY-AUOTMATION | ||
|
||
2) This matters because to run a shell script from any directory in the terminal, you have to type out the full path. In my case I have to type out ~/scripts/script.sh to run the script. | ||
<!-- --- DEPLOYMENT STATUS CODE --- | ||
3) Download the shell script file in the Repo. The .sh is the extension for shell scripts. Save the file in the directory you want to save it at - again I recommend ~/scripts as the folder to save your scripts in. | ||
Deployment Status: [![Deploy to Heroku](https://github.com/hassanaftab93/REPO-NAME/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/hassanaftab93/REPO-NAME/actions/workflows/main.yml) | ||
4) Navigate to that folder in your terminal. To be safe run ls in the terminal to check that you can see the script is there. If it's not you're in the wrong folder or step 3 didn't successfully complete. | ||
--> | ||
<!-- --- FORMAT OF MARK DOWN WITH COLLAPSIBLE MENU --- | ||
<details> | ||
<summary> | ||
<h2> | ||
</h2> | ||
</summary> | ||
5) Make the shell script executable. To do that you type the following in the terminal: chmod +x <<the-correct-filename.sh>>. This is the unix way to make a shell script "executable". | ||
</details> | ||
--> | ||
<!---------------------------------------- SECTION DIVIDER ----------------------------------------> | ||
<details> | ||
<summary> | ||
<h2> | ||
🛠 PURPOSE | ||
</h2> | ||
</summary> | ||
|
||
6) navigate to your projects folder and make a new folder that you intend to house your project. Effectively, you've got to do this: | ||
- mkdir - create a project-of-some-name inside the folder where you keep all your projects. | ||
- cd into this folder and then type pwd to get the full path. | ||
- Copy that - you will need to paste it shortly. | ||
- It should look like my-computer/my-projects/project-of-some-name | ||
This comes out of an irritation I faced personally, when I was first learning to code - setting up my local repo and syncing with Github | ||
</details> | ||
|
||
7) open your terminal again, and then type ~/scripts/<<the-correct-filename.sh>>. The script runs! You will be guided through some input... The main steps are: | ||
|
||
> what do you want to call your Github repo (don't use spaces- 'my-awesome-project' is good. Don't use 'my awesome project' as the repo name. | ||
<!---------------------------------------- SECTION DIVIDER ----------------------------------------> | ||
<details> | ||
<summary> | ||
<h2> | ||
📑 How to use | ||
</h2> | ||
</summary> | ||
|
||
> Enter a description that shows up in the Github repo's description. For this it's safe to use spaces. | ||
Download the Script | ||
```bash | ||
https://github.com/hassanaftab93/Repository-Automation/blob/main/script.sh | ||
``` | ||
Make the script executable | ||
```bash | ||
chmod +x script.sh | ||
``` | ||
Run the script | ||
```bash | ||
sh script.sh | ||
``` | ||
If You have already created your PERSONAL ACCESS TOKEN in GitHub then Enter it in the prompt when the script requests it. Otherwise, Create your PERSONAL ACCESS TOKEN and then Enter it | ||
```bash | ||
https://github.com/settings/tokens | ||
``` | ||
Script will ask you to enter a Link for a Template Repo of your choice, Enter the link. Otherwise, Press Enter without any Input | ||
```bash | ||
https://github.com/user/publicTemplateRepository | ||
``` | ||
Enter Repo Name Without spaces | ||
```bash | ||
test-Repo | ||
``` | ||
Enter Repository Description | ||
```bash | ||
This is a sample repo description. | ||
``` | ||
Enter your GitHub Username | ||
```bash | ||
octocat / user-dev | ||
``` | ||
Enter the Directory of your Projects Folder | ||
```bash | ||
/D/Folder/Projects | ||
``` | ||
The Script will now Make a Repo Folder inside the Projects Folder directory that you passed in, as well as Remotely Make a new Repository using REPO_NAME,DESCRIPTION that you passed in. | ||
|
||
</details> | ||
|
||
> Enter the project path you got in step 6, the one that you get after typing pwd in the terminal and getting something like my-computer/my-projects/project-of-some-name | ||
<!---------------------------------------- SECTION DIVIDER ----------------------------------------> | ||
<details> | ||
<summary> | ||
<h2> | ||
📚 Contributing | ||
</h2> | ||
</summary> | ||
|
||
> enter your Github username (not email address) and then your Github password. Be careful as you type as these values don't show up on the screen. | ||
Click here to learn more about: [Contributions](./docs/CONTRIBUTING.md) | ||
</details> | ||
|
||
> ....that's it. The script will set up your git repo locally inside my-computer/my-projects/project-of-some-name and then create a README.MD (blank) and then commit it locally, then set up a remote repo in Github (log you in via API) etc and then push everything up! | ||
<!---------------------------------------- SECTION DIVIDER ----------------------------------------> | ||
<details> | ||
<summary> | ||
<h2> | ||
✒️ Author | ||
</h2> | ||
</summary> | ||
|
||
> finally, you will see that the terminal you were interacting with has changed the currently active directory to your project folder. It will now be at my-computer/my-projects/project-of-some-name and you can type in ls and see the README.MD file. If you then type git status you will see your local repo's status (the state of your local project) and if you type in git remote it will show you the Github url for your project! | ||
<!-- | ||
Add More Contributors/Authors here using the following line of code: | ||
- [@username](https://www.github.com/username) | ||
--> | ||
|
||
- [@hassanaftab93](https://www.github.com/hassanaftab93) | ||
|
||
</details> | ||
|
||
<!---------------------------------------- SECTION DIVIDER ----------------------------------------> | ||
<details> | ||
<summary> | ||
<h2> | ||
🔗 Links | ||
</h2> | ||
</summary> | ||
|
||
<!-- | ||
Add your links here in the table below: | ||
Remove my Table and use your own links. | ||
|Type|Link| | ||
|:--:|:--:| | ||
|Portfolio| PORTFOLIO_LINK_HERE | | ||
|LinkedIn| LINKEDIN_LINK_HERE | | ||
--> | ||
|
||
|Type|Link| | ||
|:--:|:--:| | ||
| Portfolio | [![portfolio](https://img.shields.io/badge/my_portfolio-000?style=for-the-badge&logo=ko-fi&logoColor=white)](https://linktr.ee/hassanaftab) | | ||
| LinkedIn | [![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/hassanaftab93/) | | ||
</details> | ||
|
||
<!---------------------------------------- SECTION DIVIDER ----------------------------------------> |