Push & Commit Git on My Local File to Individual Repository in Ubuntu

0
109

Step 1. Clone your repository to your local system

Open a browser and a terminal window from your desktop. After opening the terminal window, do the following:

  1. Navigate to your home (~) directory.$ cd ~

    As you use GitHub more, you will probably work in multiple repositories. For that reason, it’s a good idea to create a directory to contain all those repositories.

  2. Create a directory to contain your repositories.$ mkdir project1
  3. From the terminal, update the directory you want to work in to your new repos directory.$ cd ~/project1
  4. From GitHub, go to your Repository Name repository.

$ git clone https://github.com/sarkeralamin/laravel-email-activation.git
Cloning into '
laravel-email-activation'...

If you get this error, enter the following at the command line:

$ git config --global core.askpass

 

Step 2. Add a file to your local repository and put it on GitHub

With the repository on your local system, it’s time to get to work. You want to start keeping track of all your space station locations. To do so, let’s create a file about all your locations.

  1. Go to your terminal window and navigate to the top level of your local repository.$ cd ~/project1/laravel-email-activation/

2. $ git status

3. git add –all

4. git commit -m "Email Activated at Registration"

 

 

If want to upload Other named Origin Let's try with Command -

 

$ git checkout master

 

# remember where the master was referencing to

$ git branch previous_master

 

# Reset master back to origin/master

$ git reset --hard origin/master

 

you can recreate master directly at origin/master with:

 

git checkout -B master origin/master

 

The git checkout man page mentions:

 

If -B is given, <new_branch> is created if it doesn’t exist; otherwise, it is reset. This is the transactional equivalent of

 

$ git branch -f <branch> [<start point>]

$ git checkout <branch> sarkeralamin

 

git push origin sarkeralamin

 

Write GitHub username and Password.

Everything Done. Cheers!!