Git

To change the default folder, right click on the GitBash Application icon and select Properties
GitBash is a Git client


Overview

There are four different areas:
1) Local Working Directory - can contain:
untracked files
tracked - unmodified files
tracked - modified files


2) Staging Area - These are changes waiting to be committed
3) Local Repository
4) Remote Repository


Bug Fix Code

git clone -b existingbranch "paste URL" 
cd projectname
<< make code changes >>
git status
git add --all
git status
git branch feature/newfeature
git checkout feature/newfeature
git commit -m "comment / JIRA ref"
git push origin feature/newfeature

Clean the solution from any debugging before removing it from Git Local


Save More Changes

git status 
git add --all
git status
git commit -m "feature/11"
git push -u origin "feature/11"


Remove old branches

git branch --all   //see all the branches 
git push origin --delete feature/oldfeature //delete a remote branch

Get the latest changes (into an empty folder)

cd myfolder 
git init
(optional) git remote add "remote_name" "copy the URL from the clone button in the UI"
git pull remote_name "branch_name"

git remote rm remote_name
git pull remote_name master
git pull remote_name feature/ribbonUI

Get the latest changes (overwrite local changes)

cd myfolder 
git init
(optional) git remote add "remote_name" "copy the URL from the clone button in the UI"
git fetch remote_name "branch_name"
git reset --hard ********* (last commit)

Integrate the latest remote changes

git pull remote_name feature/ribbonUI 

Reset all your Local Changes

git reset --hard remote_name/feature/ribbonUI 

Switching branches

git checkout develop 
git checkout feature/ribbonUI

Check in my changes

cd queda 
git init
git add --all
git status
git commit -m "RESAUTH-"
git push -u remote_name feature/ribbonUI

Delete a Folder recursively

git rm -r foldername 

Replace/Add all the modified files

clean the Visual Studio solution
replace all the files
delete the bin sub folder
delete the obj sub folder
remove the packages folder
remove the "suo" file - solution user options


If a file has been modified you must run "git add" to ensure the latest changes are in the staging area


© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited TopPrevNext