How to set your first GIT repository?

  • How to set you first GIT repository?

(1) Go-to Git hub web-site at: Github Home Site and log-in (sign in or sign up)

git_e

(2) Click on the “New Repository

git1

(3) Enter “Repository name” and click “Create repository

git2

(4) You will be redirected to your Git-hub branch web-page.

Copy the URL link to the clipboard (ctrl + c)  for step 8

git_e3

(5) Create a folder on your computer for the Git branch.

i.e. create a GIT folder on drive c:     –  mk dir  C:\GIT

(6) Copy the desired files into the folder

These file will be uploaded to your web GIT branch

(7) Download GIT installer from the following URL:  Download GIT

git_e2

  • Execute the Git installer it should insatll git and extract git-bash.exe 

(8) Run the git-bash.exe  from the installed location

i.e.  C:\Program Files\git\git-bash.exe

1

After the bash command will open, Enter these command:

$ cd c:/git

$ git init

$ git add .

$ git commit -m “first commit”

-when copy paste this line make sure the quote sign is correct!!!

Then you may receive this:

git3

You should now enter you username and email (as you defined when you signed-up [ see step 1] ). for example:

git6

Now continue:

$ git remote add origin   URL-LINK [see step 4]

   for example:  $ git remote add origin https://github.com/itayhau/JavaTest.git

$ git push -u origin master

(9) Now browse to your URL-LINK [see step 4] and you should see the files (don’t forget to refresh! )

git_e4

 

To download the repository in the future,  just use

$ git clone URL-LINK [see step 4]

   for example:  $ git clone https://github.com/itayhau/JavaTest

🙂

TortoiseGit clone: Branch or Tag

  • How to clone a branch/tag using TortoiseGit?

– Open Windows-Explorer and Browse to your desired folder
Right-click and choose Git Clone…
pic3

– Choose the correct URL + update Directory + Select Branch check-box and write the Tag name
pic4

– Choose the correct URL + update Directory + Select Branch check-box and write the Branch name
pic5

Click OK.

That’s it!