Manage Your Configs with vcsh
Now that your file's being tracked by the git repository inside vcsh, let's commit it by running the following git-like command:
bill@test:~$ git commit -m 'Initial Commit' master (root-commit) bc84953 Initial Commit Committer: Bill Childers firstname.lastname@example.org 1 file changed, 2 insertions(+) create mode 100644 .vimrc
Now for the really cool part. Just like standard git, you can push your files to a remote repository. This lets you make them available to other machines with one command. Let's do that now. First, you'll add the remote server. (I assume you already have a server set up and have the proper accounts configured. You'll also need a bare git repo on that server.) For example:
bill@test:~$ git remote add origin git@gitserver:vim.git
Next, push your files to that remote server:
bill@test:~$ git push -u origin master Counting objects: 3, done. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 272 bytes, done. Total 3 (delta 0), reused 0 (delta 0) To git@gitserver:vim.git * new branch master -> master Branch master set up to track remote branch master from origin. bill@test:~$ exit
exit line at the end. This exits the
"vcsh fake git repo". Now
your .vimrc file is checked in and copied to a remote server! If there are
other programs for which you'd like to check in configurations, like mutt, you
simply can create a new repo by running
vcsh init mutt, and then run through
the process all over again, but this time, check your files into the mutt
Move Your Configuration to Another Machine
To sync your configuration to another machine, you just need to install vcsh, git and mr, and then run a similar process as the steps above, except you'll do a git pull from your server, rather than a push. This is because you don't have the .vimrc file you want locally, and you want to get it from your remote git repository.
The commands to do this are:
bill@test2:~$ sudo apt-get install vcsh git mr bill@test2:~$ vcsh enter vim bill@test2:~$ git remote add origin git@gitserver:vim.git bill@test2:~$ git pull -u origin master From gitserver:vim * branch master -> FETCH_HEAD bill@test2:~$ exit
Now you've got your checked-in .vimrc file on your second host! This process works, but it's a little clunky, and it can become unwieldy when you start spawning multiple repositories. Luckily, there's a tool for this, and it's called mr.
Wrapping It All Up with mr
If you plan on using multiple repositories with vcsh (and you should—I'm
tracking 13 repositories at the moment), getting a configuration set up
for mr is essential. What mr brings to the table is a way to manage all the
repositories you're tracking with vcsh. It allows you to enable and
disable repositories simply by adjusting one symlink per repository, and it
also gives you the ability to update all your repos simply by running one
Perhaps the best way to get started using mr is to clone the repo that the vcsh author provides. This is done with the following command:
bill@test2:~$ vcsh clone ↪git://github.com/RichiH/vcsh_mr_template.git mr Initialized empty Git repository in ↪/home/bill/.config/vcsh/repo.d/mr.git/ remote: Counting objects: 19, done. remote: Compressing objects: 100% (14/14), done. remote: Total 19 (delta 1), reused 15 (delta 0) Unpacking objects: 100% (19/19), done. From git://github.com/RichiH/vcsh_mr_template * new branch master -> origin/master
Bill Childers is the Virtual Editor for Linux Journal. No one really knows what that means.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
|Fancy Tricks for Changing Numeric Base||May 29, 2016|
|Working with Command Arguments||May 28, 2016|
|Secure Desktops with Qubes: Installation||May 28, 2016|
|CentOS 6.8 Released||May 27, 2016|
|Secure Desktops with Qubes: Introduction||May 27, 2016|
|Chris Birchall's Re-Engineering Legacy Software (Manning Publications)||May 26, 2016|
- Tips for Optimizing Linux Memory Usage
- Secure Desktops with Qubes: Introduction
- Working with Command Arguments
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Secure Desktops with Qubes: Installation
- Fancy Tricks for Changing Numeric Base
- CentOS 6.8 Released
- Linux Mint 18
- The Italian Army Switches to LibreOffice
- Petros Koutoupis' RapidDisk
Until recently, IBM’s Power Platform was looked upon as being the system that hosted IBM’s flavor of UNIX and proprietary operating system called IBM i. These servers often are found in medium-size businesses running ERP, CRM and financials for on-premise customers. By enabling the Power platform to run the Linux OS, IBM now has positioned Power to be the platform of choice for those already running Linux that are facing scalability issues, especially customers looking at analytics, big data or cloud computing.
￼Running Linux on IBM’s Power hardware offers some obvious benefits, including improved processing speed and memory bandwidth, inherent security, and simpler deployment and management. But if you look beyond the impressive architecture, you’ll also find an open ecosystem that has given rise to a strong, innovative community, as well as an inventory of system and network management applications that really help leverage the benefits offered by running Linux on Power.Get the Guide