Wednesday, September 20, 2017

How to use my "Auto Git" for Linux

The scripts used here are all valid for Linux...
Sorry, Windows users. I just don't use Windows...
I'm not sure if any of this will apply for Mac users...?
First, create your code and setup git...then create the Repository/git init.... seek online help if you've never done this. GitHub - Start a new git repository

Create the files: gpull, gpull-and-push, and do_git from the posts I Add them to the folder: /usr/local/bin

nano /usr/local/bin/gpull
nano /usr/local/bin/gpull-and-push
nano /usr/local/bin/do_git
Note: that I did not give the files any file extension. Do not add the .sh unless you update the source file do_git to reflect those changes! Do:
chmod +x /usr/local/bin/gpull
chmod +x /usr/local/bin/gpull-and-push
chmod +x /usr/local/bin/do_git

Now, from Ubuntu Mate. Click System. Click Preferences. Click Look and Feel.
Then, click Main Menu.

Create a New Menu. Name it Git. With the menu Git Selected...Create New Items for each of your git Projects...

Click New Item. Launcher Properties: Type: Application in Terminal.
Name: Your Git Project Folder Name.
Command: /usr/local/bin/do_git "/var/www/PROJECTFOLDERwithGIT"
Click Close.

If, you do not want to install Mate, create an Desktop/Menu folder using your system... See: how-to-create-a-desktop-shortcut for Ubuntu
Add a new Feature to your code base....

Try it out...Click Applications. Click Git. Click Git Project Folder Name.

Follow the on-screen instructions....:
Your git project path will be displayed first.
Along with all branches created.
Type 0 and Press the Enter Key.
Type 2 and Press Enter.

A list of your files will appear.

-If your source code file was Modified an M will appear before the filename.

-If an ?? appears before the filename, it must be added, so Type 2 and then enter the path and filename as it was displayed in the files list. Press enter after typing in the path/file.

Now, type 0 and Press the Enter key.

Another file list appears. Your file should be listed with an M in front of it.
If it has an ??, you can add all un-tracked files by typing yes and then Enter.
Otherwise, type no and press Enter.

Are you feature complete: Type yes and press Enter. So, it does the update.
Enter a commit message and press Enter.

Follow the instructions to do a Pull first.

If you SSH for git to work and have a password, enter it....

Follow the instructions to do a Push now.

If all worked out, the message: Super job! will be shown now press Enter to exit. That's it, all done.
I found, this gem while searching for code online: 
Bonus: GIT COLORS for BASH PROMPT: See link below: 
Scott Woods - Git Prompt 
Git Colors - Based on work by halbtuerke and lakiolen. Thanks, Scott...

No comments:

Post a Comment