-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopyfilestogithub.bat
148 lines (127 loc) · 3.52 KB
/
copyfilestogithub.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
@echo off
title git helper by egg
if exist "%cd%\.git\" goto :copy
goto :setup
:setup
cls
echo it appears you have not set up a GitHub repository with this folder.
echo would you like to set one up now?
echo --------------------------------------------------------------------
echo yes no
set /P option=
if /I "%option%" EQU "Y" goto :setupinit
if /I "%option%" EQU "Yes" goto :setupinit
if /I "%option%" EQU "No" goto :setupdecl
if /I "%option%" EQU "N" goto :setupdecl
if /I "%option%" EQU "Force" goto :copyf
if /I "%option%" EQU "F" goto :copyf
cls
echo not an option...
echo ---------------------------
echo press any key to go back...
pause > nul
goto :setup
:setupdecl
cls
echo okay.
echo closing in 3s
timeout 3 /NOBREAK > nul
exit
:setupinit
cls
git init
git add .
git branch
git checkout -b main
git commit -m "Added Files."
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo paste your github repository link here.
echo DO NOT ADD ".git" TO THE END!
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set /P ghrlink=
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
git remote add origin %ghrlink%.git
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
git remote -v
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo press any key to ensure this is correct...
pause > nul
git push -f origin main
cls
echo GitHub repository linked to folder.
echo Files uploaded.
echo -----------------------------------
echo Press any key to quit...
pause > nul
exit
:copyf
cls
echo skipping...
timeout 1 /NOBREAK > nul
goto :copy
:copy
cls
echo have you copied all files to this directory? "%cd%"
echo ---------------------------------------------------
pause
cls
echo what did you do for this update?
echo ---------------------------------------------------
set /P updatereason=
cls
echo okay then, hold onto your hats!
timeout 2 /NOBREAK > nul
cls
git add .
git commit -m "%updatereason%"
git push -u origin main
echo --------------------------------------------------------------------------------------
echo finished.
echo press any key to exit...
pause > nul
exit
rem manual steps for adding a repo to a folder
rem 1. Create a new repository on GitHub:
rem - Go to GitHub.com and log in
rem - Click the '+' icon in the top right and select "New repository"
rem - Name your repository (e.g., "your-project-name")
rem - Choose public or private
rem - Don't initialize with README, .gitignore, or license
rem - Click "Create repository"
rem 2. Prepare your local project:
rem - Open a terminal/command prompt
rem - Navigate to your project folder:
rem ```
rem cd path/to/your/project
rem ```
rem 3. Initialize a Git repository locally:
rem ```
rem git init
rem ```
rem
rem 4. Add your files to Git:
rem ```
rem git add .
rem ```
rem 4.5. Now, you need to pee pee poo poo. Run these commands:
rem ```
rem git branch
rem git checkout -b main
rem ```
rem 5. Commit your files:
rem ```
rem git commit -m "Initial commit"
rem ```
rem 6. Link your local repository to the GitHub repository:
rem ```
rem git remote add origin https://github.com/your-username/your-project-name.git
rem ```
rem 6.5. Double check you're in the correct GitHub repository. Run this command:
rem ```
rem git remote -v
rem ```
rem 7. Push your files to GitHub:
rem ```
rem git push -f origin main
rem ```
rem 8. the end: