8

Git: Automatic recovery from remote repositories?

 3 years ago
source link: https://www.codesd.com/item/git-automatic-recovery-from-remote-repositories.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Git: Automatic recovery from remote repositories?

advertisements

One irritating thing I find about using command line Git is having to manually sync my repository with remote repositories. I constantly get tripped up by commands like "git status" that I (mistakenly) expect to report the difference between my working directory and a repository on GitHub. (Of course it reports the difference between my working directory and my local repository...)

Is there any way to get automatic/implicit fetching, so that remotes are always up to date? I would happily pay a penalty of a few seconds for commands like git status, git merge etc.


One of those commands is already built in.

git pull

does a fetch and a merge.

For the other one, well....define your own command, such as

alias gitfu='git fetch; git status'

The shell is yours to command.

Depending on your configuration you may be asked for pass phrase or credentials for each of these.

Related Articles

Git: linking local and remote repositories

I've been using Git for a website project. However, for technical reasons, I have to remove the ".git" folder from the local folder so that an installation is able to proceed. Afterwards, I would need to connect the local and remote repositories

Maven: xml files of metadata often downloaded from remote repositories

I'm using Maven to handle a Java project. I thought that Internet connectivity was only needed in the 1st compile to download the required libraries from the remote repositories, but I get several download messages whenever I compile code. Messages l

Automatic recovery from availability zone unavailability?

Are there any tools or techniques available to automatically create new instances in a different availability zone in the event that an availability zone suffers an outage in Amazon Web Services/EC2? I think I understand how to do automatic fail over

Git: automatically pull from the repository?

Is there any way to set up git such that it listens for updates from a remote repo and will pull whenever something changes? The use case is I want to deploy a web app using git (so I get version control of the deployed application) but want to put t

Git repository recovery from objects only

I have a Windows box which has taken it into it's head to delete most of a Git repository (must have tripped the Important Work Detector ;). All I have left (that I can find) is the objects. I'm not sure how complete the collection of objects is, eit

Retrieve unreferenced commitments from remote GIT repository

Here's the situation : some commits have been done in a remote repository. Unfortunately, someone did push -f such that no remote branch references these commits anymore. To make matters worse, I don't have those commits in my local clone. My goal is

git with IntelliJ IDEA: Unable to read from remote repository

Since a few weeks, I'm not able to pull or push from or to the remote repository. I thought it happend when upgrading to IntelliJ IDEA 14, but I can reproduce the problem with IDEA 13.1.5 as well. The tooltip says "Fetch failed fatal: Could not read

Create a remote repository from local repositories, Pycharm

I may be asking a dumb question, but I have yet to find a solution online. Using Pycharm, I have found how to create a local repository out of a regular project, but how do I then send that to github as a new remote repository? Is it possible for Pyc

push git to remote repository & ldquo; Can not read from remote repository & rdquo;

I searched for a while but I can't find a solution to my Problem. I have a Server I can connect to via ssh with the username git and a local git repository. Now I want to push my local repository to a newly created one on the Server. Here is what I d

How to stop Maven from watching in all remote repositories for app dependency files that are already installed in my local repository?

In my Maven2 project, I am depending on a jar (mule-core-2.2.1.jar) that has two dependencies which are located in remote repositories but which do not have pom files defined. So my mvn command is initially able to pull down the jars, BUT the problem

git master behind the remote master (not normally)

The server where the git repo origin/master lived died and apparently the automated backups of origin/master had broken many commits ago. So this is where things get weird. The origin/master was restored to this old backed up version that doesn't act

Git push diverges the remote and local branch

I have a local branch named as source_report_overview_Approach3 and there is a remote counterpart of it as origin/source_report_overview_Approach3 on github. At a point , both point at same commit, as shown in the below image. Now I make another comm

& ldquo; Could not read from remote repo & rdquo; & hellip; but I am the owner?

I created an organization on GitHub and I'm the owner of it. I created a repo into this organization, initialized with a Readme. I cloned it with ssh without any problem. I made some changes to commit, and when I tried to push to remote origin : $ gi

Explain the output of cat .git / config for tracking remote branches?

I'm learning in my tutorial about git and it recently gave out the output for cat .git/config for tracking remote branches as seen below. I understand that branch "master" is the master branch and origin refers to the remote tracking branch in t

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK