-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrl
More file actions
33 lines (26 loc) · 973 Bytes
/
rl
File metadata and controls
33 lines (26 loc) · 973 Bytes
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
#!/bin/bash
#: Title: remote link
#: Date: Mon Jun 3 14:59:15 DST 2019
#: Author: WessCoby
#: Version: 1.0.0
#: Description: Adding a remote link to a local repo and pushing committed files
### Git Prefix specifying the current working directory
prefix="$PWD"
#===========================================================================================
#========================= START ===========================
#===========================================================================================
### Check if current directory is a git repository
if [[ $(fe ".git") == "true" ]];
then
if [[ -n $1 ]]; then
git -C ${prefix} remote add origin $1;
git -C ${prefix} push -u origin master;
exit 0;
else
errlog "Remote Repository Link NOT Provided";
exit 0;
fi
else
errlog "This Directory is not a Git repository";
exit 0;
fi