Lessons in Linux

Finally, on your local computer, you can run the following commands to push the contents of your repo to GitHub and set GitHub as the original repo (which turns your local computer’s repo into a cloned copy from that point onward).

cd /path/to/repo git remote add origin https://github.com/accountname/nameofGitHubrepo.git

But you don’t have to remember these commands because when you create a new repo within GitHub, it gives you the commands at the bottom of the screen.

Now, in my example above, I can go to any Linux server and type git clone https://github.com/ jasoneckert/myscripts.git to clone the original repo to obtain the central copy of the shell scripts. And I can optionally make branches, do commits, push those commits back to GitHub (you’ll be prompted for your account password) and merge them into the master branch on GitHub!

To view this article and others like it visit the IT Career News blog here: Talk Tech To Me: Managing Linux Shell Script Using GIT

Made with FlippingBook Online document