Posts

Git Commands

 1. Git task Notes Git commands Tell Git who you are Configure the author name and email address to be used with your commits. Note that Git  strips some characters  (for example trailing periods) from  user.name . git config --global user.name "Sam Smith" git config --global user.email sam@example.com 2. Create a new local repository  In folder git init 3. Add files Add one or more files to staging (index): git add <filename> git add * for total stage - git add * for specific stage - git add <specific path location> 4. Commit Commit changes to head (but not yet to the remote repository): git commit -m "Commit message" 5. Status List the files you've changed and those you still need to add or commit: git status 6. Connect to a remote repository If you haven't connected your local repository to a remote server, add the server to be able to push to it: git remote add origin <server> 7.For New Branch Branches Create a new branch and swi...