Need to Know git commands
- git init (Initialize git repository)
- git checkout {branchname} - change the working branch
- git checkout -b {branchname} - create a branch and change the working branch into it
- git status - check for untrack and tracked files
- git add . - track changes in all files in the working branch
- git add {filename} - track changes in one file
- git commit -m βmessageβ - save changes to local repository
- git remote add origin {remote url} - connecting to a remote repository
- git push origin {branchname} - push code from local to remote
- git push -u origin {branchname} - push code from local to remote on a branch that doesn't already exist on remote
- git merge {branchname} - merge changes from {branchname} into the current working branch
Note: Please remember not to work on master branch directly, always create different branches for different purposes.
Top comments (0)