Publishing to github results in an empty repository - github

I am new to git. I downloaded the desktop version (for Windows). I dragged the folder containing my project into the big window, "Get started by adding a repository." All the files showed up in the left window. Then I clicked on "Publish Repository". It then shows 143 files have changed, with 0 unsynced.
But when I go to my account on the git website, the repository is empty. The only files in it are .gitattributes and .gitignore. The whole idea here is that I want to share this project with other people.
Help out a git newbie and explain how I get the entire solution into git?
Thanks!

As you already have the remote repository at GitHub, you should use the clone option first to clone your repository locally.
This will create a folder (your repository clone) on the default location containing those two files.
Then you can copy your project files to this folder and try to sync again.

Related

How to upload foders using Github desktop

I'm very new to Github and I'm trying to create a new repository that contains 2 folders ("server" and "utalk").
The "utalk" folder is my front-end and the "server" folder is my backend.
But when I use Github Desktop, it seems I only push the server folder and cant push the utalk folder.
I don't know how to push all my folders.
my Project Folder:
my GitHub repository:
First, in your file explorer, enable View hidden files
Then check if you see a .git in the utalk folder. That would make it a nested git repository, mostly ignored by your parent folder.
Switch to command-line and do a git status in utalk-project to know more about your current situation.

Add files to local repository in GitKraken

Am new to GiKraken.
I have created a local repo and remote (origin) repo.
I have added some files to the local repo (folder on my computer).
But, Gitkraken cannot find them automatically and then cannot commit.
How to add them in GiKraken manually ?
(could not find the way to do it, even "Stage" is not shown inthe community version).
A click on 1 shows your unstaged changes in area 2. The green symbol below 2 indicates a file that was added and is not yet added to your git repository. If you click on it, it will move to the Staged files area and be ready to be commited.
I'm not sure I understand your question correctly. You can not create files in GitKraken, it just manages your existing files in your repository.
If you create or copy files in your repositorys' folder (via file manager or editor or by whatever means), GitKraken will know and show the files as new files in th "Unstaged Files" section, allowing to add and commit them to your repository.

missing unstaged files in egit using eclipe form existing project

I want to make a git repository for my mod i am trying to make. I created a github remote repository and now want to create a local repository to then push to github so that I can share it with some friends.
When i make the repository in eclipse using egit I right click on the project name>Team>share project. A new window pops-up i select git then mark the project which i want to git. I first tried to unmark the "Use or create repository in parent forlder of project" and made a repository (later I also tried with this option).
Now behind the project name appears [test.test NO-HEAD]. and in my git staging view i have 3 unstaged changes : .classpath .gitnore and .project
Although I have already over 100 files in my project is still only shows 3 unstaged files. How do i make egit also stage the files i already had in my project?
You simply have to make your first commit. Do Team>Commit and in the following dialog you will see all your files.

How to get src folder under project-root folder in github when staging from eclipse using egit

Current scenario :
In Eclipse when we create a project, say a PyDev project named ‘SimpleGit’, the folder structure created by eclipse will be like
EclipseWorkingDirectory/SimpleGit/src/
correct?
If we add this to git using Egit, by right clicking on the project folder SimpleGit then Team>Share, The folder structure in which repo is formed like this
Parent Folder/ SimpleGit/ .git
Parent Folder/ SimpleGit/SimpleGit/src/
And when we stage it to remote github everything will come under
Username/ SimpleGit / SimpleGit / src /
So when we look in GitHub in the root project folder (Username/ SimpleGit) we can’t see the source folder. It will be under another folder ‘SimpleGit’. How we can avoid this?
What I want is , I want to get my source forlder(src) listed under the Project Root directory, when staging from an already built project in eclipse using egit. How do I do this?
I want like this:
https://github.com/nicholasbishop/blender
Not like this:
https://github.com/afilash/SimpleGit
it cannot be done using eGit - it assumes the Eclipse project structure.
But it can be accomplished by using git itself. Just create a repository under SimpleGit folder executing 'git init'. From that point on you'd have to manage your git repository by either git itself (command line) or some other UI. SourceTree works really well for me.
It is a bit late, I know, but this method perfectly works and I hope it is useful for anyone who sees this post from now on.
The procedure is the following:
First step is creating a repository on Github (through github.com)
Move to Eclipse IDE (Git Repositories view) and click "Clone a Git Repository and add the clone to this view". Doing that the project will be somewhere located on the hard disk. Usually, it is stored in C:\Users\username\git\projectName but you are able to change it. This is our local repository.
Once done, press (in Eclipse IDE) File->Import->Projects from Git->Existing local repository(Select the one you cloned before)->Import using the new project wizard->Finish->Java->Java Project->Specify project name (just below the dialog box there is a checked checkbox that says use default location, uncheck it. Here is where you have to specify the directory you chose while cloning the repository previously).->Next->Finish
It should be enough for creating the right directory structure.

Start using Eclipse GIT with an existing project ... project files get moved

Yesterday I wanted to start using Eclipse eGIT on an existing project following the instructions on http://www.vogella.com/articles/EGit/article.html
This tutorial suggests to have the git repository outside of the workspace, and I followed this suggestion.
After the step "5.5. Using the Git Staging view for the initial commit" I committed my initial commit. Then I continued editing one of my source files that was still open. But when I tried to save my changes, Eclipse complained that the source file was no longer there.
Then I checked both my workspace and git folder, and the project files were only in git. This is mentioned nowhere in the tutorial. Is this normal behavior?
Even more surprising: In order to continue working normally with my already open files, I copied the project subfolder from .git back to the workspace folder. And now everything seems to be fine. My changes are reflected in workspace folder as well as in "Unstaged Changes" in the Git Staging view and in git folder.
Is this expected behavior?
I found out that the files really get moved. I needed to close all the open project files and then open them from package explorer again (which will open the files from git repository).