Showing posts with label Source Control. Show all posts
Showing posts with label Source Control. Show all posts

24 April 2020

GIT Source Control commands

right click on folder which you modified 'Git Bash here' option to open linux bash.
git status                   -------→ to list all of the files checked in.
git add account/        -------→ where account is directory where so many files got changed.
git commit                 --------→ to commit all of the files, this will popup a window to enter comments.
git push                    --------→ to push checked in files to stash.

git clone [git rep link or .git file path]
or
git clone http://xxxxx/xxxxx/abc.git directory

checkout a branch: git checkout origin/feature/ABC-1234
to list branches available: git branch -r
To list the commands: git log
to open git gui: git gui
Command to merge master branch(like feature/dev) to current story branch:
git merge feature/dev
then to push the changes of local folder to feature branch repository on stash is
git push -u origin feature/ABC-26835
(OR)
git push -u origin/feature/ABC-26835

Some more frequently used commands:
 git status

git reset --hard

git pull

git checkout feature/ABC-748

refresh with master
git pull origin master
git pull origin feature/ABC-XXX

----------------------

 git clone [repo_url]
navigate to checkout directory and do checkout of branch
git clone --single-branch --branch integration [ repo_url ]
---------------------
to switch to new branch
create branch in stash
git pull
git checkout feature/ABC-1234

----------------------
command to create new branch:
git branch feature/ABC-1234
git brnach aifcs-test-xxx
git checkout feature/ABC-1234
git checkout aifcs-test-xxx
-----------------------
command to add all files checkedout/changed by you in local repo and checkin
git status
git add .
git checkin

------------------------
command to create branch in remote server:
git push --set-upstream origin aifcs-pilot-v1

git push --set-upstream origin aifcs-example-namespace-test

 

To get the current git repository url
git config --get remote.origin.url

To change the git repository url from current repository to new repository:
git remote set-url origin <git-url>
 

References: