Initial commit
This commit is contained in:
		
							
								
								
									
										17
									
								
								sthope/git_commit
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								sthope/git_commit
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
commit_message="Initial commit"
 | 
			
		||||
 | 
			
		||||
# Iterate through the arguments to find the --b flag and a branch name
 | 
			
		||||
for ((i=1; i<=$#; i++)); do
 | 
			
		||||
    if [[ "${!i}" == "--commit_msg" && ! -z "${!((i+1))}" ]]; then
 | 
			
		||||
        commit_message=="${!((i+1))}"
 | 
			
		||||
        break
 | 
			
		||||
    fi
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
git add .
 | 
			
		||||
 | 
			
		||||
git commit -m "$commit_message"
 | 
			
		||||
 | 
			
		||||
git push --set-upstream origin main
 | 
			
		||||
		Reference in New Issue
	
	Block a user