Is it possible to include .git folder - windows

I want to put my setting files in to the Git repository so I can sync them between my computers. I have the following folder structure:
d:\settings\
.git
plugins\
.git
other_things\
So, settings and plugins are separate git repositories. To track plugins folder without using submodules, I run the following command as per this post:
git add plugins/
Everything was fine, I was able to 'see' the files from plugins folder within settings up until I tried to sync it to my other computer, where plugins folder was missing its own .git directory.
Is it possible to include (exclude from .gitignore) .git folder via .gitignore somehow? I tried to use something like:
!..\.git
but it didn't work.
Thanks.

You should use submodule or subtree for that purpose. You can read more about submodules here:
http://git-scm.com/docs/git-submodule

Related

versioning different directory name from repository

I have a local directory at my/local/directory/ with the files I wish to commit to the repository named differently than 'directory'. Is it possible to do this and if so how in the command line (windows)?
Perhaps you should read the Git manual first. You can name your directory as you like. The important think is the .git folder insight your directory.
If you have no git repository then you should initialize a new one and copy your files to that directory.
http://git-scm.com/book/en/v1

Extra directories and files added to git repository

I had always used Git locally on Mac OSX and decided to try out Github and Bitbucket. I had some issues getting it working and tried a few fixes that others suggested who had similar problems. I was able to push to Github and Bitbucket, but I also managed to somehow add extra directories and files to my repository in the process.
I'm using Xampp to develop locally, and I have a folder in there that I created my repository with, so the file structure is something like this
Applications
XAMPP
xamppfiles
htdocs
myproject -this is was originally the repository that I had been using
randomdirectory1
randomdirectory2
randomdirectory3
randomfile1
randomfile2
One thing to note. Not every single directory and file in htdocs was added to my repository. There were only 3 added, and about 7 other folders.
Prior to trying out github my repository just consisted of myproject located in /Applications/XAMPP/xamppfiles/htdocs/myproject. Now, there are a bunch of other directories and files added to it. I know this, because in conjunction with the command line I also used GitX for a visual reference. Now, all of these extra files and directories are showing up.
Maybe I don't fully understand how git repositories works. Prior to this, I had only used add, commit and checkout commands. All I know is that my repository appears to be different in GitX and matches on Bitbucket/Github.
What folder did you initialize the Git repo from? It sounds like you meant to init from the myproject folder, but instead you did it from the Applications folder.
Does GitHub show all those extra directories?
Where is the hidden .git folder?
Is this a private repo just for you, or just for you and a few known others? Are you willing to rewrite history?

Changed folder structure in Xcode Project not reflected in Git Repository

I have an Xcode project that is under version control. I've grouped the classes in the project navigator into folders based on what the classes do (eg. Models, Views, Controllers, etc.). However, these folder structures seem local to my machine and it is not reflected in my own local git repository, or if I do a git pull from another machine, the folders that I've created or organized my classes into don't appear. So, How do you get the changes you make (organizing the classes into folders) to reflect in your local and remote repository?
Try this
# modified, new and deleted files
git add -A
ref
I found that the adding a folder or directory manually inside the local repository to work for me. Create the folder in the repository,git add folder_name/ to actually track and add it to the repo. The files then can be moved into this folder. Depending on how you move it, you may need to do git rm <file_name> and git add </folder_name/file_name>.

How to point gitbox/git to different local directory

Hi guys I have a remote repository cloned locally, Because my new changes have saved it to a different directory (workspaces in eclipse) I want to point git to the workspace directory rather than the other directory, how do I do this? Gitbox doesn't seem to have any options, and I can't see the .git folder
In your WORKSPACE do
git init
and then from where you pulled your copy initially. Do
git pull /path/to/your/workspace/project/dir

Create git repository after project creation

I know there's an option to make a local repository for your project when you first create it, but is there an option create a repository after you've created your project?
Sure, just run the following command in your project directory:
git init
This will create the .git directory containing an empty repository. Then, add and commit your files.
In the command prompt, make sure you're in the desired directory and perform a git init and you will have created an empty repository.
You can then proceed to add the files and directories to the repository by doing
git add <filename1> <filename2> ...
or you can select whole directories and use * to act as a wild card of sorts.
git add ./*
If you have any more questions check out these pages:
http://gitref.org/creating/
http://gitref.org/basic/#add
Hope this helps.
You should go to your Xcode menu, click Source Control > Create Working Copy...
Xcode will automatically create your .git folder repository.
Good luck, and make sure you have a backup of your project before trying something else.

Resources