jupyter notebooks not seen by GitHub - linux

I have some local jupyter notebooks in my Linux virtual machine. I would like to make a repository with them on Github.
I downloaded Github Desktop as it seems easier than using command line.
The issue, is that when I select the file containing my notebooks (which I put on a share folder with my host OS (windows)) to add a repository, then on Github Desktop its still written '0 changed files', hence I can not commit to master. When I publish the repository, then its obviously empty :(.
Any suggestion would help me, I am new to Git.
Thank you very much!

You must add the files to a local clone of your GitHub repository.
Create a repository on GitHub with the name of the project.
Clone project to your desktop using GitHub Desktop.
Move all folder contents from your share folder on Windows to the cloned repository folder in the GitHub folder, probably inside of your Documents folder.
Follow the prompts on the GitHub Desktop client to add files to repository. Commit changes. And push the changes to GitHub's server.
You may find it easier to read the GitHub Desktop tutorial for more information on how to use GitHub. https://help.github.com/desktop/guides/contributing-to-projects/

Related

Newbie GIT Help - Making a second Repository

I currently work on solutions / projects within a single GIT repository, in Visual Studio. The commits I make are to a local folder on the Visual Studio server, and then I use the command 'git push origin master' (after having changed directory to my local folder / repository) to push commits to a Gitlab in my company's corporate space. The purpose of this is less about using branches and software development (as I am the only person who does any work on this), and more about having a way to rollback changes and keep a master copy off the server.
I now want a fresh copy of this GIT repository, so I can use that as a new baseline for an application migration. I will still continue to work on the existing repository too.
What is the best way to make a copy of the existing repository, that I can treat as a totally separate thing, without accidently messing up my existing config on the server? Should I do the clone from the Gitlab? Or clone locally and then push that up to the new space in my Gitlab? Honestly, I'm a bit confused at this point about the proper model for this stuff.
....................
Sounds like you'd like to fork the project: keep the existing repo and start a new, separate repo based on the old one.
Browse to your project in Gitlab
On the main repo screen, click "fork" in the top right
Select a new/ the same organisation as you'd like
The project is now forked!
From here, you can clone the fork to your local machine in a new folder. These are now separate projects, and code updates can be added, committed and pushed to the separate repos.

Automatic update local repository

I'm having trouble creating some sort of automatic deployment function with Github
So, what I have is a repository on Github, and a local folder in my Ubuntu connected to that repository on Github, and what I want to achieve is, that everytime I upload/Add a new file to the repository on Github, I can somehow run a script that updates the local folder on my Ubuntu, with those new files stored in my repository on Github.
So to sum it up;
1.Upload new files to repo in Github
2.Run script on local Ubuntu machine
3. Newly uploaded files in repo in Github gets added to local folder on Ubuntu machine.
Is there anyways to achieve this? Thanks!
That seems to be a case for webhook, which comes with a constraint: your machine should be reachable from github.com.
If that is the case, you can setup a listener (for instance, alexandru/github-webhook-listener), which will detect JSON payload sent by GitHub on each push on your repository.
That local listener can then trigger a simple git pull in your local repository, updating its content that way.

Node.js update via GitHub

So I am currently using node.js to make a Discord bot. I am switching the way things work however. The bot runs from my machine (computer), but I would like my friends to be able to work on it as well. Is there any way we can clone a GitHub repo into an existing folder, as to update the current BOT.js file we have?
The point of this is to have the bot auto update via github
You can create an empty Github repository, make sure to create it without any readme etc before you have made your first push.
Then using git, you initialize a git repo inside your current folder you are working out of, when you have done that, you can set a upstream to Github (w/ the repository URL you got for your newly created repository (on Github)), then just commit your files, push them to the Github repo master branch and you should be good to go.
Hope that helps!

How do I sync my local repo with my live website, backwards and forwards? Git

I have figured a way (using a few different tutorials) on how to push a local repo to a remote --bare repo that the uses a post-receive hook to push the contents to a live location.
So in brief explanation of my current situation
Make a change to a website locally
Use "git push live master"
Commit gets uploaded to remote repo
Remote repo pushes the contents to /home/unixuser/public_html
But say on this website there is an upload form where an admin can upload articles (on the live site), or where users can upload profile images. How would I sync my local repo with the new content in "public_html" as the repo is actually stored somewhere else on the server?
This sounds pretty simple but whenever I search for this I seem to get just the part on how to do post-receive scripts and how to upload, rather than the download part... or an over bloated explanation that leaves me confused. Is there a simplified answer to this question or am I possibly going about the whole thing the wrong way.
Any answers are appreciated, thanks!
Maybe you just need a copy script for whenever a new file is uploaded to copy it in your repo, commit + push that.
An other solution would be to use a second repository:
git-ignore the upload directory in your current repo. use a second repo which runs on the server, watching the upload directory - you just need to syncronize it to your local machine then. with git-ignore in the old repo, you could actually place the "upload"-repo inside the folder structure of the old repo (like it is on your server folder structure?)

How to sync git on ubuntu with existing github projects?

I used mac github client to push my codes to my github account. On my Ubuntu linux computer I wan't to connect to github using the terminal so that it will automatically sync will all my projects on github. How would I do it? All the online help I have bumped in to so far only show how to clone an exiting git repository not how to connect to my github account and sync it.
git, the revision control system, doesn't know anything about Github, a website that keeps track of and hosts your git repositories for you. The concept of a Github account is totally alien to git, so you'll never be able to, say, browse all of the projects you own on Github with a git command. git only works on the level of individual repositories.
Github also provides a graphical client that handles both the git level stuff and the Github level stuff -- it understands what a Github account is, and will log in for you and display all of the repos associated with the account. It's also a fully featured git client that does a lot of work on the level of individual repos for you. However, this graphical client is currently only available for Windows and OS X, and is not available for Linux.
My own workflow on Linux is to use the github.com website plus the command-line git tool. To bridge the gap between Github and git, you need to git clone individual repos. Aside from that, you can do Github administrative tasks on the website, and you can work with individual repos with git on the command line.
If you don't like this work flow, you need to look at graphical git clients for Linux. I'm not sure if any exist that will do both git-level stuff and also interface with Github specifically and understand the idea of a Github account.
You could also theoretically try to run the Windows client in wine on Linux, but I would not recommend this approach except as a last resort.
First I don't know a program that automatically sync all my github repositories.
First you have to install git (if it has not been done already) tutorial
Than you should generate a rsa:key to be able to 'push' your repositories to github.
You can generate a rsa_key by following this tutorial notes ssh-add id_rsa should be ssh-add id_rsa.pub ....also you can name id_rsa as anything you want: like bran_rsa_key
You should post or add your rsa_key to git hub at this address. If you go to that link you will see that you already have some key for your Mac but nothing for your Ubuntu.
After installation you could install ungit if you're not that familliar with git

Resources