Use GitHub on Windows

How to start a project when programming under Windows. Experiment.

GitHub has become the most popular site for hosting projects due to the proposed features that allow you to contribute to the software code. This is not the only free hosting based on the Git general contribution software originally created for Linux, but this is where most of the projects are laid out.

Until recently, it was difficult to use GitHub with a local post for Windows, but now this is a bygone era, and provided that you know exactly how to go, creating a repository and sending code has become very convenient.

Since February 2016, after creating a project, you can place files online directly from the browser by dragging and dropping them. But this is suitable for simply downloading several files, updating a project one day, several files of which have been changed, deleted, added, synchronization tools are necessary .

Everything goes in three stages...

1) Create an account

Go to the github.org and create an account. You can also create "reposts" with the name of your project, but this is not necessary.

2) Create a project

It is assumed that the code has already been written, and it is located in the "monogamy" directory.

a) With FDI (not recommended )

Download GitHub graphics software for Windows. This software converts the catalog containing the source code into a ready-to-load project.

Enter your GitHub account name and password. This data is saved and every time you start the program, you will automatically connect.

As you can see below, the interface prompts you to drag and drop the directory containing your sources...

Client GitHub pour Windows

This is all that needs to be done to create a project. After that, I recommend abandoning this software. In theory, it also allows you to place files online, but this never works and you can never understand why.

Before continuing, you must also go to the project directory and delete the automatically generated .gitignore file, as it may contain restrictions that do not match your file list.

b) Or on the command line (recommended)

Download the tool in Git for Windows. Run the executable and pass many parameters. Git needs to run in its own console, which is opened in the Windows application list, with a button on the bottom left.

Go to your administrative panel GitHub, in the list of contributions and click the "new" button on the right.

Enter a project name and description. Then open the GitHub shell at the local post.

3) Include code in repository

It is best to use a command shell to place code on the Internet. This is a Powershell window created by the same program for Windows.

Open Git Shell and enter the project directory. The following line appears:

c:\monprogramme [master]>

By default, your project is the main branch. We will not discuss the creation of multiple branches in this article.

To bring the code online for the first time

:
git init
git add .
git commit -m "infos" 
git remote add origin [url de votre projet]
git push origin master

Replace "information" with the text that you want to see on the GitHub website and which describes "commit," that is, this version of the project .

Check on GitHub that the project was created correctly and the list of files in it.

Deleting files

:

Clear the files in the local project directory and enter :

git add -u
git commit -m "Update"
git push origin master

Replace Update with the information text of your choice.

To add or replace existing

files, do the following:
git add -A
git commit -m "Update"
git push origin master

These commands are sufficient to create an online image of the project and update it after each source code change.

After checking on the repository that all files are present and necessary for the project, you can still add a specific file using the command:

git add nom-de-fichier

and:

git rm nom-de-fichier

to delete...

19-03-2013 18:25:01

Other tool

A new solution is offered to simplify access to the Git repository in Windows: SourceTree. The more complete software provided by the GitHub company specializing in this site avoids the use of the command line. But it is still in beta today and should be used carefully. Command execution may be slow on some computers.
There is also TortoiseGit, which performs most of the functions required for open source management. Here, in-line orders are placed from the interface.
21-08-2013 9:05:02

Ungit

Another tool that works well with Githube, Ungit is particularly simple. But it seems to be more suitable for personal projects, because this does not make the difference between the branches of the master on others.