Skip to content

Commit 8da6e06

Browse files
version_control_automation script added
1 parent 4c809a0 commit 8da6e06

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Version_control_automation_script
2+
3+
Short description of package/script
4+
5+
- This Script Was simple to setup
6+
- Need import subprocess module to interact
7+
8+
9+
## Setup instructions
10+
11+
12+
Just Need to import subprocess module and then run the Version_control_automation_script.py file and for running python3 is must be installed!
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import subprocess
2+
3+
def create_and_commit_branch(branch_name, commit_message):
4+
# Create a new branch
5+
subprocess.run(["git", "checkout", "-b", branch_name])
6+
7+
# Make changes to files (modify, add, remove)
8+
# ...
9+
10+
# Commit the changes
11+
subprocess.run(["git", "add", "."])
12+
subprocess.run(["git", "commit", "-m", commit_message])
13+
14+
# Push the changes to the remote repository
15+
subprocess.run(["git", "push", "origin", branch_name])
16+
17+
if __name__ == "__main__":
18+
new_branch_name = "feature/awesome-feature"
19+
commit_msg = "Added an awesome feature"
20+
21+
create_and_commit_branch(new_branch_name, commit_msg)

0 commit comments

Comments
 (0)