1
1
# git-sisters-update.ps1 from within http://github.com/wilsonmar/git-utilities.
2
2
# by Wilson Mar ([email protected] , @wilsonmar)
3
3
4
- # This script was created for experiementing and learning Git.
4
+ # This script was created for experiementing and learning Git with GitHub .
5
5
# Git commands in this script are meant as examples for manual entry
6
6
# explained during my live "Git and GitHub" tutorials and
7
7
# explained at https://wilsonmar.github.io/git-commands-and-statuses/).
21
21
# Sample call in MacOS running PowerShell for Mac:
22
22
# chmod +x git-sisters-update.ps1
23
23
# ./git-sisters-update.ps1
24
+ # results in "Add " as branch name. Alternately, run script with your own branch:
25
+ # ./git-sisters-update.ps1 "Add year 1979"
24
26
25
27
# Last tested on MacOS 10.12 (Sierra) 2015-11-29
26
28
# http://skimfeed.com/blog/windows-command-prompt-ls-equivalent-dir/
@@ -171,10 +173,17 @@ if (Test-Path ".gitignore"){
171
173
# exit #4
172
174
173
175
174
- # Run another script file to define git configuration at the repo level:
175
- Invoke-Expression " ./git_client-config.ps1"
176
+ echo " ******** Run PowerShell file for Git configurations at the repo level:"
177
+ $ScriptPath = Split-Path $MyInvocation.InvocationName
178
+ Write-Host " Path:" $MyInvocation.MyCommand.Path
179
+ # NOTE: PowerShell accepts both forward and backward slashes:
180
+ & ((Split-Path $MyInvocation.InvocationName ) + ' /git_client-config.ps1' )
181
+ # Alternately, use & to run scripts in same scope:
182
+ # & "../git_client-config.ps1 global" #
183
+ # Alternately, use . to run scripts in child scope that will be thrown away:
184
+ # . "../git_client-config.ps1 global" #
176
185
177
- # exit #5
186
+ exit # 5
178
187
179
188
cd ${REPONAME}
180
189
$CurrentDir = $ (get-location ).Path;
@@ -244,7 +253,12 @@ git l -10
244
253
echo " ******** git checkout master branch:"
245
254
git checkout master
246
255
247
- $CURRENT_BRANCH = " feature1"
256
+ # Default is local:
257
+ if ( $args [0 ] -eq " " ) {
258
+ $CURRENT_BRANCH = " feature1"
259
+ }else {
260
+ $CURRENT_BRANCH = $args [0 ]
261
+ }
248
262
echo " ******** git checkout new branch $CURRENT_BRANCH from master branch :"
249
263
git checkout - b $CURRENT_BRANCH
250
264
git branch - avv
@@ -265,7 +279,7 @@ sisters_new_meta_file Mimi true "boots"
265
279
echo " ******** git status : before git add :"
266
280
git status
267
281
echo " ******** git add :"
268
- git add photo- info.md bebe.md heather.md laurie.md mimi.md
282
+ git add . # photo-info.md bebe.md heather.md laurie.md mimi.md
269
283
echo " ******** git status : after git add "
270
284
git status
271
285
echo " ******** git commit of $CURRENT_YEAR (new commit SHA) :"
0 commit comments