-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit_begin
More file actions
executable file
·83 lines (70 loc) · 1.73 KB
/
git_begin
File metadata and controls
executable file
·83 lines (70 loc) · 1.73 KB
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
#!/bin/bash
# $1 = Project Name
# Get variables
USER=$(git config --global user.name)
PROJECT=$1
# Create and enter git directory
mkdir $PROJECT
cd $PROJECT
# Create beginning files
# README
touch README
echo "This is the README for $PROJECT" >> README
# .gitignore
touch .gitignore
echo "main
*.swp
*.swo
*.o" >> .gitignore
# Makefile
touch Makefile
echo "CC = g++
CFLAGS = -Wall
LDFLAGS =
OBJFILES =
TARGET = main
all: \$(TARGET)
\$(TARGET): \$(OBJFILES)
\$(CC) \$(CFLAGS) -o \$(TARGET) \$(OBJFILES) \$(LDFLAGS)
clean:
rm -f \$(OBJFILES) \$(TARGET) *~" >> Makefile
# Create Objects
PWD=`pwd`
COUNT=0
for object in "$@"; do
if [ $COUNT -ne 0 ]; then
object_maker $object
else
# Skip first item (project name)
let COUNT=COUNT+1
fi
done
# main
touch main.cc
echo "#include <iostream>
int main(int argc, char* argv[]) {
return 0;
}" >> main.cc
sed -i "/^OBJFILES/ s/$/main.o /" Makefile
# Make first commit
git init
echo "Project initialized..."
vim README
echo "README updated..."
git add .
<<<<<<< HEAD
git commit -m "First commit of $PROJECT"
#git remote add origin https://github.com/$USER/$PROJECT.git
=======
git commit -m "First commit of $PROJECT: Check README"
git branch -m master develop
echo "develop branch created (HEAD)..."
git branch release
echo "release branch created..."
echo "First commit is set. Ready to push the develop branch..."
echo "Go to https://github.com/new and make a new repo with the project name: $PROJECT"
read -p "Press enter once done"
git remote add origin https://github.com/$USER/$PROJECT.git
git push origin develop
echo "Develop branch successfuly pushed. Release branch is ready for merge when a releaseable version of develop is ready! Happy Building!!"
>>>>>>> 6218677e29466891c4a07853dc69808df7b0231a