'Make a script for automatically updating the links from external server to our internal gitlab server

I am working with a open source repo that I have cloned in my development environment. When I want to update the internal git repo, I enter the folder /home/pranav/Desktop/ and do:

  1. git pull upstream master
  2. Make edits, save, git add , and git commit all in your local repo
  3. Push changes from local repo to your fork on gitlab.com ( git push origin master )
  4. Update the central repo from your fork ( Pull Request )

But then, every morning I have to do the same thing for the updating the repo. This is quite troublesome.

Can I put this in a Bash script? I mean, if I write these git commands in the shell script, and run it, will I be able to update the repo automatically whenever there are any commits in the original repo?

other way: 1. git fetch- check for any commits 2. if commits found, then git pull 3. Go with stashing for any local changes.

I was thinking of writing something like this...



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source