Track existing folder from remote git repo

Elmo

Somehow the .git folder got deleted from my project folder. My project folder may contain changes which I don't know of. Maybe it can be older than the remote version on GitHub.

Is there a way I can start tracking everything again so that I can run git status to see the changes?

Eran

You can create the .git folder in your project folder by :

$ git init

Then you can add and commit all the files you wish :

$ git add .
$ git commit -m 'some comment'

Then you add the remote repository (the exact command depends on your project name in GitHub and your credentials to access it) :

$ git remote add origin git@gitserver:/opt/git/project.git

Now you can do git fetch to get all the branches from the remote version, and decide what to do with them.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Git Status/Track remote repo // Edited

From Java

Make an existing Git branch track a remote branch?

From Dev

Adding svn-remote to existing git repo

From Dev

Adding svn-remote to existing git repo

From Dev

Push existing Git repo to a folder in svn

From Dev

Push existing Git repo to a folder in svn

From Dev

Bring a local folder to remote git repo

From Java

Git push existing repo to a new and different remote repo server?

From Dev

Push local new Git repo to existing remote repo as branch?

From Dev

Make an existing Git branch track a remote branch with JGit?

From Dev

New file from existing in same Git repo

From Dev

Fetch specific commit from remote git repo

From Dev

Clone GIT Repository Subfolder into existing Repo with identical folder structure

From Dev

New git repo from selected files in existing repo

From Dev

git adds file from outside repo folder?

From Dev

How to link folder from a git repo to another repo?

From Java

Git: How to remove remote origin from Git repo

From Dev

Working with remote repo git

From Dev

Git clone remote repo into another remote repo

From Dev

reassign an existing remote repo to my local repo

From Dev

Git - folder not pushed to repo

From Dev

Change Git Repo Folder

From Dev

Create a git bare repo from two existing repository

From Dev

Opening an existing Tower git repo from the command line

From Dev

How to remove a file from git repo on local and remote

From Dev

How to disconnect local git repo from remote master

From Dev

Creating a git repo on a remote server from a local machine

From Dev

Going remote from local repo: Git and forgetting large files

From Dev

Stop getting Git tags from specific remote repo

Related Related

HotTag

Archive