Programming
May 28

Git commands

• config --global user.name "my name" - select a username. Similarly for email selection


• init (in folder with proj) - connect git


• add <file_name> - add one file


• add . - add all files in folder


• commit -m "what done"


• status - show all uncommitted files


• clone <url_of_repository> - copy proj


• remote add origin <url_repo> - connect local repo with remoted


• branch <branch_name> - create a new branch


• checkout <branch_name> - change current branch


• merge <branch_name> - add your branch to main branch


• push origin <branch_name> - add brach to remote repository


• pull - get all changes which was made in remoted repo (update version repo)


• revert <commit_hash> - cancel commit and back to past


• log - show history of all commits in current branch with their hashes and messages


• rebase <branch_name> - transfer commits from branch to branch where user is