In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "how to share files with Git". In daily operation, I believe many people have doubts about how to share files with Git. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "how to share files with Git". Next, please follow the editor to study!
Git for file sharing
One of the advantages of Git is its inherent distribution capability. It can be used to establish sharing. Even if you are only sharing repositories with other computers on your network, Git brings transparency to the behavior of getting files from shared locations.
With the development of its interface, Git becomes very simple. Although it varies from user to user, the only thing they have in common when they sit down and do some work is git pull or the slightly more complex git pull & & git checkout-b my-branch. However, for some people, entering commands into their computers is completely confusing or annoying. Computers are designed to make life easier. They are good at repetitive work, so there are easier ways to share files with Git.
SparkleShare
The SparkleShare project is a cross-platform, open source Dropbox-style file sharing application based on Git. It automatically executes all Git commands by dragging and dropping files into a specially specified SparkleShare directory, triggering add, submit, push, and pull processes. Because it is based on Git, you can get fast push and pull based on diff, and inherit all the advantages of Git version control and back-end infrastructure such as Git hooks. It can be fully self-hosted or can be used with Git managed services such as GitLab, GitHub, Bitbucket, and so on. In addition, since it is basically just a front end of Git, you can access files in SparkleShare on devices that may not have a SparkleShare client but have a Git client.
Just as you get all the benefits of Git, you will be subject to all the common Git limitations: using SparkleShare to store hundreds of photos, music, and videos is impractical because Git is designed and optimized for text. Git can of course store large files of binaries, but because it can track history, once a file is added to it, it is almost impossible to delete it completely. This somewhat limits the usefulness of SparkleShare for some people, but makes it well suited to many workflows, including scheduling.
Install SparkleShare
SparkleShare is cross-platform, and installers for Windows and Mac are available from the website. For Linux, there is a Flatpak installation package, or you can run the following command from the terminal:
$sudo flatpak remote-add flathub https://flathub.org/repo/flathub.flatpakrepo$ sudo flatpak install flathub org.sparkleshare.SparkleShare creates a Git repository
SparkleShare is not a software as a service (SaaS). You run SparkleShare on your computer to communicate with the Git repository, while SparkleShare does not store your data. If you don't already have a Git repository to synchronize with folders, you must create a folder before starting SparkleShare. You have three choices: hosted Git, self-hosted Git, or self-hosted SparkleShare.
Managed Git
SparkleShare can be stored using any Git repository you can access, so if you have an account for GitLab or any other managed service (or create one), it can be the back end of SparkleShare. For example, open source Notabug.org service is a Git hosting service similar to GitHub and GitLab, but its uniqueness is enough to prove the flexibility of SparkleShare. Different managed services have different ways to create new repositories depending on the user interface, but all major repositories follow the same common model.
First, find the button in the managed service to create a new project or repository and click it to get started. Then step through the process of creating the repository, providing the repository with a name, a level of privacy (the repository usually defaults to public), and whether to initialize the repository with an README file. Whether you need a README file or not, initialize and create one. Using a file to create a repository is not absolutely necessary, but it forces the Git host to instantiate master branches in the repository, which helps ensure that front-end applications, such as SparkleShare, have branches to commit and push. Even if the file is an almost empty README file, it can be used to view the file to confirm that you have successfully connected.
Creating a Git repository
After you create the repository, get the URL it uses for SSH clones. Just like getting its URL from a Git project, you can also get this URL: navigate to the repository page and find the "Clone" button or field.
Clone URL of GitHub.
Clone URL of GitLab.
This is the address that SparkleShare uses to get the data, so please write it down. Your Git repository is now configured.
Self-hosted Git
You can use SparkleShare to access the Git repository on any computer you have access to. No special settings are required except for an Git naked repository. However, if you want to grant access to the Git repository to anyone else, you should run a Git manager such as Gitolite or SparkleShare's own Dazzle server to help you manage your SSH keys and accounts. At the very least, create a Git-specific user so that users who have access to your Git repository do not automatically gain access to the rest of the server.
Log in to the server as Git (if you are very good at managing user and group permissions, you can log in as your own user) and create a repository:
$mkdir ~ / sparkly.git$ cd ~ / sparkly.git$ git init-bare.
Your Git repository is now configured.
Dazzle
SparkleShare developers provide a Git management system called Dazzle to help you host your own Git repository.
On your server, download the Dazzle application to a location in your path:
$curl https://raw.githubusercontent.com/hbons/Dazzle/master/dazzle.sh-output ~ / bin/dazzle$ chmod + x ~ / bin/dazzle
Dazzle sets up a user specific to Git and SparkleShare, and also implements access based on the key generated by the SparkleShare application. Now, you only need to set up one project:
$dazzle create sparkly
Your server is now configured for SparkleShare hosting.
Configure SparkleShare
When you start SparkleShare for the first time, you will be prompted to configure the server that SparkleShare uses for storage. This process may look like an installation wizard that runs for the first time, but it is actually the usual process of setting up a new shared location in SparkleShare. Unlike many shared drive applications, SparkleShare allows you to configure multiple locations at a time. The first shared location you configure is no more important than any shared location you can configure later, and you don't have to sign up for SparkleShare or any other service. You simply point the SparkleShare to the Git repository so that it knows how to keep the first SparkleShare folder synchronized.
On the first screen, give an identity information that SparkleShare will use in the Git submission record made on your behalf. You can use any content, even falsified information that doesn't mean anything. It is only used to submit messages, and if you are not interested in reviewing Git back-end processes, you may not even see them.
The next screen prompts you to select the host type. If you are using GitLab, GitHub, Planio or Bitbucket, you can choose the appropriate one. Otherwise, select your own server.
Choosing a Sparkleshare host
At the bottom of this screen, you must enter the clone URL of SSH. If you are a self-hosted Git, the address is similar to, and the remote path is the absolute path to the Git repository created for this purpose.
According to the self-hosting example above, the address of my fictional server is ssh://git@example.com:22122 (: 22122 represents a non-standard SSH port) and the remote path is / home/git/sparkly.git.
If I use the Notabug.org account instead, the address in the above example is ssh://git@notabug.org and the path is seth/sparkly.git.
SparkleShare will fail the first time you try to connect to the host because you have not copied the SparkleShare client ID (the SSH key specific to the SparkleShare application) to the Git host. This is expected, so don't cancel the process. Leave the SparkleShare settings window open and get the client ID from the SparkleShare icon in the system taskbar. Then copy the client ID to the clipboard so that it can be added to the Git host.
Getting the client ID from Sparkleshare
Add your client ID to the managed Git account
Except for a small UI difference, the process of adding a SSH key to any managed service (as is the case for all client ID) is basically the same. In the Web dashboard of your Git host, navigate to your user settings and find the "SSH key" category. Click the "add New key" button (or similar button), and then paste the contents of your SparkleShare client ID.
Adding an SSH key
Save the key. If you want others (such as collaborators or family members) to have access to the same repository, they must provide you with their SparkleShare client ID so that you can add it to your account.
Add your client ID to your self-hosted Git account
The SparkleShare client ID is just a SSH key, so copy and paste it into the Git user's ~ / .ssh/authorized_keys file.
Use Dazzle to add your customer ID
If you use Dazzle to manage your SparkleShare project, add the client ID using the following command:
$dazzle link
When Dazzle prompts you for the ID, paste the client ID found in the SparkleShare menu.
Use SparkleShare
After adding the client ID to the Git host, click the retry button in the SparkleShare window to complete the setup. After cloning the repository, you can close the SparkleShare Settings window and find a new SparkleShare folder in your home directory. If you set up a Git repository with managed services and choose to include README files or license files, you can see them in the SparkleShare directory.
Sparkleshare file manager
In addition, there are some hidden directories that you can view by displaying them in the File Manager.
Showing hidden files in GNOME
You use SparkleShare in the same way as any directory on your computer: put files in it. Whenever a file or directory is placed in a SparkleShare folder, it is copied to your Git repository in the background.
Exclude certain files
Because Git is designed to remember everything, you may want to exclude specific file types from the record. There is a reason to exclude some files. By defining files that are free from SparkleShare management, you can avoid accidentally copying large files. You can also design a solution for yourself so that you can logically belong to the same file (for example, MIDI file and its .flac export file) stored in a directory, but you can back up large files manually while letting SparkleShare back up text-based files.
If you do not see hidden files in the file manager of the system, display them. Navigate to your SparkleShare folder, then go to the directory that represents your repository, find a file named .gitignore, and open it in a text editor. You can enter a file extension or file name in .gitignore (one per line), and any files that match the files you list will be ignored (as shown by the file name).
Thumbs.db$RECYCLE.BIN/.DS_Store._*.fseventsd.Spotlight-V100.Trashes.directory.Trash-**.wav*.ogg*.flac*.mp3*.m4a*.opus*.jpg*.png*.mp4*.mov*.mkv*.avi*.pdf*.djvu*.epub*.od {s ·t} * .cbz
You know which file types you encounter most often, so focus on the files that are most likely to sneak into your SparkleShare directory. If you want to overdo it a little bit, you can find a good collection of .gitignore files on Notabug.org and throughout the Internet.
By saving these entries in a .gitignore file, you can put large files that do not need to be sent to the Git host in the SparkleShare directory, and SparkleShare will ignore them completely. Of course, this means that you need to make sure that they can be backed up or otherwise distributed to your SparkleShare collaborators.
Automation
Automation is one of the tacit understandings we have with computers: computers perform repetitive and boring tasks, and we humans are either not good at doing these or memorizing them. SparkleShare is a good and simple way to automate routine data distribution. But in any case, this is not for every Git repository. It has no interface for advanced Git functions, no pause buttons or manually managed operations. It doesn't matter, because its scope of use is intentionally limited. SparkleShare can do what it plans to do, it does well, and it's a Git repository you don't need to care about.
If you want to use this stable, invisible automation, try SparkleShare.
At this point, the study on "how to share files with Git" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.