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 email@example.com 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!
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Profiles and RC Files
- Understanding Ceph and Its Place in the Market
- Astronomy for KDE
- The Giant Zero, Part 0.x
- SoftMaker FreeOffice
- Maru OS Brings Debian to Your Phone
- Git 2.9 Released
- OpenSwitch Finds a New Home
- What's Our Next Fight?
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide