Quick guid to rolling a git [–version-control] on windows 10 and connect remote
All you need….
- git [ www.git-scm.com ]
- notepad ++ or similar [ www.notepad-plus-plus.org ]
- GitHub account or similar [ www.github.com/join?source=header-home ]
Download git and install [leave everything as is, but install notepad++ or similar to use as code editor, unless you like to use vim].
Sign up for GitHub and create a repository.
From the command line [cmd], move to the directory you want to contain your .git repository.
Type the following command to create your git username and e-mail:
git config --global user.name "<your name>"
git config --global user.email "<your e-mail>"
Once done, find the new created repository on GitHub - clone or download repository address, then type:
git clone https://github.com/YourUserName/RepositoryName.git
There should be a new folder in the current directory, move into it:
List the remote repositories:
You should see [origin]. Now see if the path is the correct one, with:
git remote -v
Done. You have successfully connected your git repository.
Let’s create a new file and push it to your online repository.
start notepad NewFile.txt
Check current status of your branch and untracked files.
Should look similar to this:
On branch master Your branch is up to date with "origin/master". Untracked files: (use "git add <file>..." to incude in what will be committed) NewFile.txt nothing added to commit but untracked files present (use "git add" to track)
Add the file to git as mentioned under [status] above or [add .] for all files.
git add NewFile.txt
git add .
The file is now in [staging] try to run [git status] again. You should see your file in green that should be committed. To commit the file with a note run:
git commit -m "First file"
Finally, your file moved from your workspace to your local repository and now needs to be pushed to the remote repository.
Note: There are also the following commands, you need most likely, if you either work on different PC’s or with other people on the same repository [no comments]:
git pull git fetch git push origin master git branch <New Branch> git branch -a git checkout <Branch Name> git push --set-upstream origin <Branch Name> git merge <Branch Name> git branch -d <Branch Name> git push origin --delete <Branch Name>