Git useful commands

git commands

1. Initialize the local directory as a Git repository.

    git init

2. Add the files in your new local repository. This stages them for the first commit.

    git add .

3. Commit the files that you've staged in your local repository.

    git commit -m "First commit"

4. Create a repository at github account

5.In Terminal, add the URL for the remote repository where your local repository will be pushed.

    git remote add origin remote repository URL

6. Verifies the new remote URL

    git remote -v

7.Push the changes in your local repository to GitHub.

    git push origin master

8. if too many old untracked files are seen in git status then do this,

    git reset --hard

It will make git repo to last commit state.

Comments

Popular posts from this blog

dev_get_platdata understanding

Getting started with pinctrl subsystem linux

How to take systrace in android