20 September,2023 by Rambler
Compiling a list of GIT commands used regularly in my daily work. Adding more over the next few daysModels
MODELS
========
Gitflow - Focus on long lif feature branches and multiple primary branches . More collaboration required - and strict development method.
Trunk-based development - Developers merge small, regular update to the core - trunk also know as "main branch" . Used in CI\CD
BASICS
=====
--Clone the repository to the local machine
git clone https://mygithub2.com/myproject.git
--Check status of file
--Files marked in red are in the file system, but Git not tracking them yet.
git status
--Track the file
git add myFilename
-- Commit aka save your file to the local copy of the project’s Git repository
git commit -m "a commit test"
--show refs
git show-ref
--Show commit history
git log
--Display unstaged changes
git diff
PUSH
======
--Push aka your changes from you up to GitHub
--origin = repository of copy in GitHub
git push origin <replace_with_branch_name>
BRANCHES
======
--Display branches in the repo
git branch
--Create and check out a new branch named <MyBranch>. Don't use the -b flag for checking out an existing branch.
git checkout -b <MyBranch>
CONFIG
======
git config --global http.sslVerify false
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |